Skip to main content

Metadata for Foliant.

Project description

Metadata for Foliant

This extension adds the meta generate command to Foliant, which generates the yaml-file with project metadata. It also allows to add other meta commands meta <command> which use the generated metadata.

Installation

$ pip install foliantcontrib.meta

Specifying metadata

Metadata for the main section (more on sections in User's Guide below) may be specified in the beginning of a Markdown-file using YAML Front Matter format:

---
id: MAIN_DOC
title: Description of the product
key: value
---

You may also use regular XML-like format with meta tag:

<meta
    id="MAIN_DOC"
    title="Description of the product"
    key="value">
</meta>

If meta tag is present, all Metadata from YAML Front Matter is ignored.

meta generate command

Usage

To generate meta file run the meta generate command:

$ foliant meta generate

Metadata for the document will appear in the meta.yml file.

Config

Meta generate command has just one option right now. It is specified under meta section in config:

meta:
    filename: meta.yml

filename : name of the YAML-file with generated project metadata.

User's guide

Metadata allows you to specific properties to your documents, which won't be visible directly to the end-user. These properties may be:

  • the document author's name;
  • Jira ticket id;
  • date of last revision;
  • or anything else, there is not limitation.

This module is required for metadata to work in your projects. But it doesn't care about most of the fields and their values. The only exception being the id field. See Special fields section.

Sections

You can specify metadata for a whole chapter and for it's portions, which are called sections. Section is a fragment of the document from one heading to another one of the same level of higher.

Metadata, specified at the beginning of the document (before the first heading), is applied to the whole Markdown document. We call it the main section of the chapter.

Note that you can specify metadata for the main section either in YAML Front Matter format, or with meta tag.

If you specify metadata after the heading of some level, it will be applied to all content inside this heading, including all other nested headings. See the illustration below.

Special fields

Right now there's only one field that is treated specially: the id field.

If specified, it will used as identificator of the section. Note that IDs must be unique within the whole project.

If id field is omited — the section will get auto generated id based on:

  • chapter filename for main section,
  • title for general sections.

Additional info

Metadata works only for files, mentioned in the chapters section in foliant.yml. All other files in src dir are ignored.

When using includes, all metadata from the included content is removed.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

foliantcontrib.meta-1.2.0.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

foliantcontrib.meta-1.2.0-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file foliantcontrib.meta-1.2.0.tar.gz.

File metadata

  • Download URL: foliantcontrib.meta-1.2.0.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.1

File hashes

Hashes for foliantcontrib.meta-1.2.0.tar.gz
Algorithm Hash digest
SHA256 62e71ace79646a1a1b7a7ddda156e8d4b6cdd25cb761b7ae24cc9526a5d134ce
MD5 f91e33ce16d775b2975dc75e929aaad7
BLAKE2b-256 0e4226aa28921ef051467fffabc19394c545e99dc945627c3d9e4b391667c763

See more details on using hashes here.

File details

Details for the file foliantcontrib.meta-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: foliantcontrib.meta-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 14.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.1

File hashes

Hashes for foliantcontrib.meta-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5ebff36b6f7993c5df8cc05167d9207b4ea2ba07635f8c2236c4a1972899dd59
MD5 62699b4503484eca4630f49604a08900
BLAKE2b-256 c9dd9eaaee21caa4f0f0c5bcb826f96035ff5ffb65e143cfcc59ead457063e99

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page