Markdown dialect with support to metadata and toml serialization
Project description
Getting started with quick-notes
Markdown dialect with support to metadata and toml serialization. Read the docs.
Features
- Markdown with metadata.
- Markdown <--> toml.
- CLI to generate and validate .md and .toml quick-notes.
What is a quick-note?
A quick-note is a markdown document labeled with a set of metadata and that can be exported to toml format.
Why quick-note
- Programmatically update of markdown documents.
- General purpose toml format.
Markdown quick-note
A markdown quick-note is a markdown text wrapped within special
markdown comments starting with <!--BEGIN--> and ending with
<!--END-->.
Here is the ingredients.md file.
<!--BEGIN id=0 date="2022-12-30T09:07:33.934408" -->
# 2022-12-30T09:07
I should remember to buy:
- Apples
- Milk
- Sugar
<!--END-->
A markdown quick-note text always starts with a title. The <!--BEGIN-->
statement accepts any list of key-value attributes that could be represented as
a string or as an integer.
Any quick-note in the markdown document can be easily update or removed thanks to the markdown quick-note parser.
Toml quick-note
A markdown quick-note can be converted to the general purpose toml format. Therefore, the markdown quick-notes data can be used in a different markup/render mechanism of choice.
The ingredients.md above would have the corresponding ingredients.toml:
[[list_of_quick_note]]
id = 0
date = "2022-12-30T09:07:33.934408"
title = "2022-12-30T09:07"
text = "I should remember to buy\n\n- Apples\n- Milk\n - Sugar\n\n"
CLI application
The CLI application supports the following commands:
- generate-toml: converts a markdown quick-note to toml quick-note.
- generate-markdown: converts a toml quick-note to markdown quick-note.
- validate: check if a toml quick-note and a markdown quick-note are equivalent.
- generate-quick-note: generate a toml quick-note according to a data-layout.
To create toml quick-notes you need to specify a data-layout.
Data Layout
A data layout is a python dataclass with support to write and read toml files. The quick-notes package comes with a single data layout named: QuickNote.
@dataclass
class QuickNote(QuickNoteBase):
id: int
date: str
One can extend the QuickNote class or create its own. The attributes specified in the data-layout will be automatically
rendered in both markdown and toml representations of the quick-note.
Instantiate derived classes of QuickNoteBase using keyword arguments only. Otherwise, the attributes
could be assigned values different from those expected.
API module
The CLI application relies on the quick-notes api. One can import the module api to create new applications using quick-notes.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file quick_notes-1.0.1.tar.gz.
File metadata
- Download URL: quick_notes-1.0.1.tar.gz
- Upload date:
- Size: 11.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0337641b46ba1d4a95b69b338042757f542f86a6c8705d8aa55174a495b6781a
|
|
| MD5 |
6edc16dd0c01f899df4ea417903a8523
|
|
| BLAKE2b-256 |
1703de0d686f8b06359314d8f4c59aa4dad8d2df8f375f952c0df3f726e7bdf1
|
Provenance
The following attestation bundles were made for quick_notes-1.0.1.tar.gz:
Publisher:
publish-package.yml on danoan/quick-notes
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
quick_notes-1.0.1.tar.gz -
Subject digest:
0337641b46ba1d4a95b69b338042757f542f86a6c8705d8aa55174a495b6781a - Sigstore transparency entry: 453847682
- Sigstore integration time:
-
Permalink:
danoan/quick-notes@2a6770800bcb983bdfb4fc30497be04dd62428cb -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/danoan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-package.yml@2a6770800bcb983bdfb4fc30497be04dd62428cb -
Trigger Event:
release
-
Statement type: