Skip to main content

Managing Markup Files

Project description


Build Status codecov

🏛 Managing Markup Files


from typing import Tuple

from bibliothek.toc import ToC, Note

t = ToC(base='path/to/dir', file_pattern=r'^.+\.md')

@t.on_sort('path', 'to')
def _(note: Note):
    return note['created date']

def _(note: Note):
    return note['last updated date']

def _() -> str:
    return '# ToC'

def _() -> str:
    return '_Generate by Bibliothek_'

def _(curr_dir: Tuple[str]) -> str:
    return f'## {curr_dir[-1]}' if len(curr_dir) > 0 else None

def _(curr_dir: Tuple[str]) -> str:
    return '\n'

def _(note: Note) -> str:
    # path would be inserted into front matter and auto escaped
    return f'- [{note["title"]}]({note["path"]})'


Project details

Download files

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

Files for bibliothek, version 0.2.0
Filename, size File type Python version Upload date Hashes
Filename, size bibliothek-0.2.0-py3-none-any.whl (19.2 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size bibliothek-0.2.0.tar.gz (5.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page