### Setup Virtual Environment and Install Livemark Source: https://livemark.frictionlessdata.io/pages/guides-and-tutorials/data-journalism.html Commands to initialize a Python virtual environment and install the Livemark package. ```bash $ python3 -m venv .python $ source .python/bin/activate ``` ```bash $ pip install livemark ``` -------------------------------- ### Start Development Server Source: https://livemark.frictionlessdata.io/pages/getting-started/starting-project.html Launch the livereload server to preview the project locally. ```bash $ livemark start ``` -------------------------------- ### Install Livemark Source: https://livemark.frictionlessdata.io/pages/getting-started/installation.html Use pip or pipx to install the Livemark library on your system. ```bash $ pip install livemark ``` -------------------------------- ### Install dependencies Source: https://livemark.frictionlessdata.io/pages/getting-started/contributing.html Installs the necessary project dependencies using the Makefile. ```bash $ make install ``` -------------------------------- ### Configure site settings Source: https://livemark.frictionlessdata.io/pages/feature-reference/general.html Example configuration for site assets like favicons and stylesheets. ```yaml site: favicon: assets/favicon.ico styles: - style.css ``` -------------------------------- ### Verify Installation Source: https://livemark.frictionlessdata.io/pages/getting-started/installation.html Check the installed version of Livemark to ensure the installation was successful. ```bash $ livemark --version ``` ```text 1.0.0 ``` -------------------------------- ### Install an external plugin Source: https://livemark.frictionlessdata.io/pages/plugin-system/adding-plugin.html Use pip to install a Livemark plugin package. ```bash $ pip install livemark-ckan ``` -------------------------------- ### Task output example Source: https://livemark.frictionlessdata.io/pages/feature-reference/markdown.html The rendered output of the executed task. ```text print('It is a task') ``` ```text It is a task ``` -------------------------------- ### Activate an external plugin Source: https://livemark.frictionlessdata.io/pages/plugin-system/adding-plugin.html Enable the installed plugin by adding its configuration to the livemark.yaml file. ```yaml ckan: true # or a plugin config ``` -------------------------------- ### Tabbed code snippets Source: https://livemark.frictionlessdata.io/pages/feature-reference/navigation.html Examples of CLI and Python code snippets organized under tabs. ```bash echo 'Hello World' ``` ```text Hello World ``` ```python print('Hello World') ``` ```text Hello World ``` -------------------------------- ### Initialize Project Directory Source: https://livemark.frictionlessdata.io/pages/getting-started/starting-project.html Create and enter a new directory for the project. ```bash $ mkdir my-project $ cd my-project ``` -------------------------------- ### Build a website using CLI Source: https://livemark.frictionlessdata.io/pages/feature-reference/general.html Commands to build a website from source files. These commands are functionally equivalent. ```bash $ livemark build $ livemark build index.md $ livemark build index.md --target index.html ``` -------------------------------- ### Build and Serve Commands Source: https://livemark.frictionlessdata.io/pages/getting-started/building-website.html Commands to generate static HTML or initiate a development server with automatic reloading. ```bash # Build a single document (index.md by default) $ livemark build ``` ```bash # Start a livereload server $ livemark start ``` -------------------------------- ### Clone the repository Source: https://livemark.frictionlessdata.io/pages/getting-started/contributing.html Initial steps to download the project source code and navigate to the directory. ```bash $ git clone git@github.com:frictionlessdata/livemark.git $ cd livemark ``` -------------------------------- ### Execute and List Tasks Source: https://livemark.frictionlessdata.io/pages/guides-and-tutorials/python-development.html Commands to list available tasks and execute them via the Livemark CLI. ```bash $ livemark run ``` ```bash test-lint test-code ``` ```bash $ livemark run test ``` ```bash Test Link Test Code ``` ```bash $ livemark run test-code ``` ```bash Test Code ``` -------------------------------- ### Configure Project Settings Source: https://livemark.frictionlessdata.io/pages/getting-started/starting-project.html Define site metadata and configuration in the livemark.yaml file. ```yaml brand: text: My Project site: favicon: assets/favicon.ico ``` -------------------------------- ### Define Main Page Source: https://livemark.frictionlessdata.io/pages/getting-started/starting-project.html Create the required index.md file to serve as the project homepage. ```markdown # My Project It will be great here ``` -------------------------------- ### Build and Serve with Custom Paths Source: https://livemark.frictionlessdata.io/pages/getting-started/building-website.html Specify a custom Markdown file path for building or serving if the default index.md is not used. ```bash $ livemark build path/to/your/file.md $ livemark start path/to/your/file.md ``` -------------------------------- ### Configure Prepare Commands Source: https://livemark.frictionlessdata.io/pages/feature-reference/others.html Specify a list of Bash commands to execute before the document building process begins. ```yaml prepare: - cp data/table.csv table.csv ``` -------------------------------- ### Include Local Files Source: https://livemark.frictionlessdata.io/pages/feature-reference/markdown.html Displays content from a local file with syntax highlighting. ```python '''python file livemark/__init__.py ''' ``` ```python from .config import Config from .document import Document from .markup import Markup from .plugin import Plugin from .project import Project from .program import program from .server import Server from .settings import VERSION as __version__ from .snippet import Snippet from .system import system from . import errors ``` -------------------------------- ### Implement pagination container Source: https://livemark.frictionlessdata.io/pages/feature-reference/navigation.html Use the livemark-pagination class to enable pagination for content blocks. ```html
{% for number in range(1, 1001) %}
{{ number }}
{% endfor %}
``` -------------------------------- ### Configure site navigation in livemark.yaml Source: https://livemark.frictionlessdata.io/pages/feature-reference/navigation.html Define the structure of the website navigation menu using the pages key in the project configuration. ```yaml pages: items: - name: Introduction path: index - name: Getting Started items: - path: pages/getting-started/installation - path: pages/getting-started/configuration ``` -------------------------------- ### Create a virtual environment Source: https://livemark.frictionlessdata.io/pages/getting-started/contributing.html Optional step to isolate project dependencies using a Python virtual environment. ```bash $ python3 -m venv .python $ source .python/bin/activate ``` -------------------------------- ### Configure project about text Source: https://livemark.frictionlessdata.io/pages/feature-reference/appearance.html Adds descriptive project information to the top right corner of the site. ```yaml about: text: Livemark is a Python static site generator... ``` -------------------------------- ### Execute a task via CLI Source: https://livemark.frictionlessdata.io/pages/feature-reference/markdown.html Run the defined task using the livemark run command followed by the task ID. ```bash $ livemark run example ``` -------------------------------- ### Configure site brand text Source: https://livemark.frictionlessdata.io/pages/feature-reference/appearance.html Sets the project name displayed in the top left corner of the site. ```yaml brand: text: Livemark ``` -------------------------------- ### Run tests Source: https://livemark.frictionlessdata.io/pages/getting-started/contributing.html Executes the test suite using Pytest and Pylama for linting. ```bash $ make test ``` -------------------------------- ### Register a custom plugin programmatically Source: https://livemark.frictionlessdata.io/pages/plugin-system/adding-plugin.html Use the system.register method to add a custom plugin class to the Livemark system. ```python from livemark import system system.register(CustomPlugin) ``` -------------------------------- ### Build a document as Markdown Source: https://livemark.frictionlessdata.io/pages/feature-reference/general.html Command to render a document specifically as a Markdown file. Note that plugin support is limited in this mode. ```bash $ livemark build source.md --target target.md ``` -------------------------------- ### Release the project Source: https://livemark.frictionlessdata.io/pages/getting-started/contributing.html Triggers the release process after updating the version file. ```bash $ make release ``` -------------------------------- ### Configure Cleanup Commands Source: https://livemark.frictionlessdata.io/pages/feature-reference/others.html Specify a list of Bash commands to execute after the document building process completes. ```yaml cleanup: - rm table.csv ``` -------------------------------- ### Configure Redirects Source: https://livemark.frictionlessdata.io/pages/feature-reference/others.html Define a redirect table for GitHub Pages hosting, which generates a 404.html file for client-side redirection. ```yaml redirect: items: - prev: getting-started next: pages/installation ``` -------------------------------- ### Execute Data Tasks Source: https://livemark.frictionlessdata.io/pages/guides-and-tutorials/data-journalism.html Commands to list, run all, or run specific data tasks defined in the project. ```bash $ livemark run ``` ```text data-extract data-transform data-load ``` ```bash $ livemark run data ``` ```text Data Extract Data Transform Data Load ``` ```bash $ livemark run data-load ``` ```text Data Load ``` -------------------------------- ### Create Responsive HTML Grid Source: https://livemark.frictionlessdata.io/index.html Embed Bootstrap-styled HTML within Markdown. Adding the livemark-markdown class allows Markdown syntax inside HTML elements. ```html '''html markup
![Package](assets/data-package.png)

Data Package

A simple container format for describing a coherent collection of data in a single package.

''' ``` -------------------------------- ### Build a document programmatically Source: https://livemark.frictionlessdata.io/pages/feature-reference/general.html Build a single document without generating the full site structure using the Python API. ```python from livemark import Project project = Project('source.md', target='target.md', config={"site": False}) project.document.build() ``` -------------------------------- ### Implement infinite scroll container Source: https://livemark.frictionlessdata.io/pages/feature-reference/navigation.html Use the livemark-infinity class to enable infinite scroll functionality for content blocks. ```html
{% for number in range(1, 1001) %}
{{ number }}
{% endfor %}
``` -------------------------------- ### Execute Python Data Transformation Source: https://livemark.frictionlessdata.io/index.html Utilize the Frictionless Framework to process datasets. The output displays the transformed rows. ```python from pprint import pprint from frictionless import Resource, transform, steps brands = transform( Resource("data/cars.csv"), steps=[ steps.table_normalize(), steps.table_aggregate(group_name="brand", aggregation={"price": ("price", max)}), steps.row_sort(field_names=["price"], reverse=True), steps.row_slice(head=5), ], ) pprint(brands.read_rows()) ``` ```text [{'brand': 'Volkswagen', 'price': 785}, {'brand': 'Hyundai', 'price': 774}, {'brand': 'Skoda', 'price': 756}, {'brand': 'Suzuki', 'price': 725}, {'brand': 'Renault', 'price': 724}] ``` -------------------------------- ### Create Responsive HTML Grid Source: https://livemark.frictionlessdata.io/pages/feature-reference/markdown.html Embed HTML with Bootstrap classes to create responsive layouts. Use the html markup block syntax. ```html '''html markup

Data Package

A simple container format for describing a coherent collection of data in a single package.

''' ``` -------------------------------- ### Render tables with DataTables Source: https://livemark.frictionlessdata.io/index.html Configure table rendering by specifying a data source file and optional column definitions in YAML. ```yaml '''yaml table data: data/cars.csv width: 600 order: - [3, 'desc'] columns: - data: type - data: brand - data: model - data: price - data: kmpl - data: bhp ''' ``` -------------------------------- ### Render a Frictionless Data Package Source: https://livemark.frictionlessdata.io/pages/feature-reference/markdown.html Embeds a Frictionless Data Package using a descriptor URL. ```yaml '''yaml package descriptor: https://raw.githubusercontent.com/fjuniorr/cicd-gh-pages-rmarkdown/main/datapackage.json ''' ``` -------------------------------- ### Document (class) Source: https://livemark.frictionlessdata.io/pages/feature-reference/markdown.html Represents a Livemark document. Provides methods to build, read, write, and manage document content and plugins. ```APIDOC ## Document(source, *, target=None, format=None, project=None, path=None) ### Description Initializes a new Document instance. ### Parameters - **source** (Any) - Required - Path to the document source. - **target** (Any) - Optional - Target path. - **format** (Any) - Optional - Document format. - **project** (Any) - Optional - Associated project. - **path** (Any) - Optional - Document path. ### Methods - **build(*, diff=False, print=False)** - Build the document. - **get_plugin(name)** - Get document's plugin by name. - **process()** - Process the document. - **read()** - Read the document. - **write(*, diff=False, print=False)** - Write the document. ``` -------------------------------- ### Enable comments via frontmatter or configuration Source: https://livemark.frictionlessdata.io/pages/feature-reference/blogging.html Comments can be enabled for individual articles via frontmatter or globally for all pages using the project configuration file. ```yaml comments: code: livemark link: https://livemark.frictionlessdata.io ``` ```yaml comments: code: livemark link: https://livemark.frictionlessdata.io ``` -------------------------------- ### Configure GitHub Repository Information Source: https://livemark.frictionlessdata.io/pages/feature-reference/others.html Manually define the GitHub user and repository name if automatic inference from the local .git directory is insufficient. ```yaml github: user: frictionlessdata repo: livemark ``` -------------------------------- ### Test Code Snippets in Markdown Source: https://livemark.frictionlessdata.io/pages/guides-and-tutorials/python-development.html Demonstrates how Livemark executes Python scripts within Markdown documents during the build process. ```python '''python script mylib.command('Hello World') ''' ''' Hello World ''' ``` -------------------------------- ### Configure article frontmatter Source: https://livemark.frictionlessdata.io/pages/feature-reference/blogging.html Use frontmatter in your markdown file to specify the author and associated image for a blog post. ```yaml blog: author: John Doe image: ../assets/example.png ``` -------------------------------- ### Configure Google Analytics Source: https://livemark.frictionlessdata.io/pages/feature-reference/others.html Enable a Google Analytics counter across all project pages by providing the tracking code. ```yaml counter: type: google code: G- ``` -------------------------------- ### Configure footer notes format Source: https://livemark.frictionlessdata.io/pages/feature-reference/appearance.html Defines the date format for the last updated timestamp shown in the footer. ```yaml notes: format: %Y-%m-%d ``` -------------------------------- ### Render a Table Schema Source: https://livemark.frictionlessdata.io/pages/feature-reference/markdown.html Displays an interactive table schema based on a JSON descriptor file. ```yaml '''yaml schema descriptor: data/cars.schema.json ''' ``` -------------------------------- ### Add external links to site configuration Source: https://livemark.frictionlessdata.io/pages/feature-reference/navigation.html Define external links to appear in the right column of the website. ```yaml links: items: - name: Frictionless path: https://frictionlessdata.io - name: Discord path: https://discord.com/channels/695635777199145130/695635777199145133 - name: Twitter path: https://twitter.com/frictionlessd8a ``` -------------------------------- ### Render Vega Lite Chart Source: https://livemark.frictionlessdata.io/index.html Use the yaml chart block to define visualisations. Replace single quotes with backticks to render. ```yaml '''yaml chart data: url: data/cars.csv mark: circle selection: brush: type: interval # other options are omitted width: 500 height: 300 ''' ``` -------------------------------- ### Embed Audio or SoundCloud Source: https://livemark.frictionlessdata.io/pages/feature-reference/markdown.html Renders an audio file or SoundCloud track using a unique identifier. ```yaml '''yaml audio/soundcloud code: 34445479 ''' ``` -------------------------------- ### Add site news banner Source: https://livemark.frictionlessdata.io/pages/feature-reference/appearance.html Displays a news message at the top of the site. ```yaml news: text: It's test news ``` -------------------------------- ### Override configuration with document frontmatter Source: https://livemark.frictionlessdata.io/pages/getting-started/configuration.html Use YAML frontmatter at the top of a markdown file to set document-specific configurations that take priority over project settings. ```yaml --- site: title: My Title --- # My Document ``` -------------------------------- ### Enable repository star rating Source: https://livemark.frictionlessdata.io/pages/feature-reference/appearance.html Configures the display of a GitHub repository's star rating based on the Github feature setting. ```yaml rating: type: start ``` -------------------------------- ### Embed Data Visualizations Source: https://livemark.frictionlessdata.io/pages/guides-and-tutorials/data-journalism.html Using the chart extension to render data visualizations within Markdown. ```yaml '''yaml chart data: url: ../../data/cars.csv mark: circle selection: brush: type: interval # other options are omitted width: 500 height: 300 ''' ``` -------------------------------- ### Configure table of contents selector Source: https://livemark.frictionlessdata.io/pages/feature-reference/navigation.html Specify the heading level used for the automatically generated table of contents in the project configuration. ```yaml topics: selector: h2 ``` -------------------------------- ### Process tabular data with Jinja Source: https://livemark.frictionlessdata.io/index.html Use the frictionless variable to iterate over CSV resources within Jinja templates. ```jinja {% for car in frictionless.Resource('data/cars.csv').read_rows(size=5) %} - {{ car.brand }} {{ car.model }}: ${{ car.price }} {% endfor %} ``` -------------------------------- ### Render a Video Source: https://livemark.frictionlessdata.io/pages/feature-reference/markdown.html Embeds a video file or a YouTube video using a unique identifier. ```yaml '''yaml video/youtube code: NMg-eCbO6L0 ''' ``` -------------------------------- ### Define Tasks in Markdown Source: https://livemark.frictionlessdata.io/pages/guides-and-tutorials/python-development.html Syntax for defining bash and python tasks within a Markdown file using task IDs. ```markdown '''bash task id=test-lint echo 'Test Lint' ''' '''python task id=test-code print('Test Code') ''' ``` -------------------------------- ### Render a Validation Report Source: https://livemark.frictionlessdata.io/pages/feature-reference/markdown.html Displays an interactive validation report based on a JSON descriptor file. ```yaml '''yaml report descriptor: data/invalid.report.json ''' ``` -------------------------------- ### Render a GeoJSON Map Source: https://livemark.frictionlessdata.io/pages/feature-reference/markdown.html Use the map directive to visualize GeoJSON data. Replace single quotes with backticks to execute. ```yaml '''yaml map data: data/france.json ''' ``` -------------------------------- ### Create a Custom Plugin Source: https://livemark.frictionlessdata.io/pages/plugin-system/writing-plugin.html Defines a custom plugin class inheriting from Plugin that modifies H1 tags by injecting a span element. ```python from livemark import Plugin class CustomPlugin(Plugin): identity = "custom" # Process def process_markup(self, markup): markup.add_markup("(template)", target="h1") ``` -------------------------------- ### Snippet (class) Source: https://livemark.frictionlessdata.io/pages/feature-reference/markdown.html Represents a Livemark snippet. Provides properties to access snippet metadata and a process method to handle document integration. ```APIDOC ## Snippet(input: str, *, header: List[str]) ### Description Initializes a new Snippet instance. ### Parameters - **input** (str) - Required - Textual snippet content. - **header** (List[str]) - Required - An array of the snippet's header. ### Properties - **header** (List[str]) - Snippet's header. - **input** (str) - Snippet's input. - **lang** (str) - Snippet's lang. - **output** (Optional[str]) - Snippet's output. - **props** (Dict[str, Any]) - Snippet's props. - **type** (str) - Snippet's type. ### Methods - **process(document: Document) -> None** - Process the snippet within a given document. ``` -------------------------------- ### Define Data Tasks in Markdown Source: https://livemark.frictionlessdata.io/pages/guides-and-tutorials/data-journalism.html Embedding bash and python tasks directly into Markdown files for data processing workflows. ```markdown '''bash task id=data-extract echo 'Data Extract' ''' '''python task id=data-transform print('Data Transform') ''' '''python task id=data-load print('Data Load') ''' ``` -------------------------------- ### Define a Python task Source: https://livemark.frictionlessdata.io/pages/feature-reference/markdown.html Use the task identifier in the code block header to define a runnable Python script. ```python '''python task id=example print('It is a task') ''' ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.