### Install Writer Framework and Create Demo Application (Shell) Source: https://github.com/writer/writer-framework/blob/dev/README.md These shell commands provide a quick way to get started with Writer Framework. The first command installs the framework using pip, and the second command creates a demo application named 'hello' in a new subfolder and launches the framework's visual editor (Writer Framework Builder) accessible via a local URL. ```bash pip install writer writer hello ``` -------------------------------- ### Install Writer Framework in editable mode Source: https://github.com/writer/writer-framework/blob/dev/CONTRIBUTING.md Installs the Writer Framework package in editable mode, including build dependencies, using Poetry. This allows for direct development on the installed package. ```Shell poetry install --with build ``` -------------------------------- ### Manage Writer Framework Applications (Shell) Source: https://github.com/writer/writer-framework/blob/dev/README.md These shell commands illustrate the lifecycle management of Writer Framework applications. `writer create` initializes a new application project, `writer edit` launches the visual editor for an existing application, and `writer run` starts the application, making it accessible for use. ```bash writer create my_app writer edit my_app writer run my_app ``` -------------------------------- ### Install development dependencies Source: https://github.com/writer/writer-framework/blob/dev/CONTRIBUTING.md Installs all development-specific dependencies required for contributing to the project, using the 'alfred' tool. ```Shell alfred install.dev ``` -------------------------------- ### Run Writer Framework application Source: https://github.com/writer/writer-framework/blob/dev/CONTRIBUTING.md Starts a Writer Framework application, such as 'apps/hello', on a specified port (e.g., 5000) for local development and testing. ```Shell writer edit apps/hello --port 5000 ``` -------------------------------- ### Activate Poetry virtual environment Source: https://github.com/writer/writer-framework/blob/dev/CONTRIBUTING.md Activates the Poetry-managed virtual environment for the project, making project dependencies available in the shell session. ```Shell poetry shell ``` -------------------------------- ### Initialize and Update State in Writer Framework (Python) Source: https://github.com/writer/writer-framework/blob/dev/README.md This Python snippet demonstrates how Writer Framework manages application state. It initializes a global state with a 'counter' variable and defines an event handler function, `handle_increment`, which modifies the state. This state-driven approach allows for reactive UI updates based on backend logic. ```python import writer as wf def handle_increment(state): state["counter"] += 1 wf.init_state({ "counter": 0 }) ``` -------------------------------- ### Global and Application-Specific CSS Styles Source: https://github.com/writer/writer-framework/blob/dev/src/ui/index.html This snippet defines the core CSS rules for the Writer framework, including a universal box-sizing reset, default font properties, Material Symbols integration, and specific styles for the main application container and a loading animation. It ensures consistent rendering and provides visual feedback during initial load. ```css Writer * { box-sizing: border-box; margin: 0; padding: 0; font-family: inherit; color: currentColor; -webkit-font-smoothing: antialiased; } body { font-size: 13px; } .material-symbols-outlined { font-family: 'Material Symbols Outlined Variable', sans-serif; font-size: 100%; font-style: normal; font-weight: 400; } #app { isolation: isolate; } #app > * { min-height: 100vh; } #loading_L1 { width: 100%; display: flex; align-items: center; justify-content: center; position: relative; } #loading_L2 { position: absolute; background: conic-gradient(from 180deg at 50% 50%, #FFF 0deg, #A95EF8 360deg); width: 113px; height: 113px; top: calc(50% - 56.5px); left: calc(50% - 56.5px); border-radius: 50%; animation: logoAnimation 1s infinite linear; } #loading_L1 svg { top: calc(50% - 49.5px); left: calc(50% - 49px); position: absolute; } @keyframes logoAnimation { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } ``` -------------------------------- ### Basic Page Layout and Typography with CSS Source: https://github.com/writer/writer-framework/blob/dev/src/writer/templates/auth_unauthorized.html This CSS snippet defines the foundational styles for a web page. It sets the background and text colors, specifies a modern font family (Poppins), and centers content using flexbox. Additionally, it styles a central container, adjusts font sizes and weights for headings (h1, h2), and adds top margin to images for spacing. ```css body { background-color: #ffffff; color: #000000; font-family: Poppins, sans-serif; display: flex; align-items: center; justify-content: center; } #container { text-align: center; width: 50%; color: #5A677C; font-size: 14px; font-style: normal; font-weight: 400; } h1 { font-size: 40px; font-weight: 600; line-height: 118%; margin: 0; color: #000000; } h2 { color: #6985ff; margin: 0; margin-top: 8px; margin-bottom: 18px; font-size: 24px; font-weight: 600; line-height: 35px; } img { margin-top: 48px; } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.