Skip to content

Glob syntax for "chapters" in foliant.yml config #66

@v4dkou

Description

@v4dkou

We have two cases, where it would be desirable to forgo explicit enumeration of chapters:

  1. When we already use numbers/alphabetic order on the file system level
  2. When we don't care about the order of chapters at all

If pyyaml supports multiple tags, this syntax would be desirable

chapters: !glob !path chapters/**/*.md
// or when we care about order of chapters _surrounding_ some block of chapters
chapters: 
   - index.md
   - !glob !path chapters/**/*.md
   - last_chapter.md

If pyyaml does not support multiple tags, something like !glob_path would be nice, or even just accept glob syntax by default.

Temporary solutions

Currently we use this snippet to automatically add chapters to config

find src -type f -name "*.md" | sort --numeric-sort | sed "s/src\// - /" >> foliant.yml

Alternatively, one could use a snippet to form a different file completely automated, but

find src -type f -name "*.md" | sort --numeric-sort | sed "s/src\// - /" > chapters.yml

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions