Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

Add support for custom Parsers of Markdown metadata/attributes (for YAML, Joplin, etc); Make the current Elixir Map parser one of the parser options #30

Closed
alfredbaudisch opened this issue Sep 18, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@alfredbaudisch
Copy link
Owner

alfredbaudisch commented Sep 18, 2021

Make it similar to dashbitco/nimble_publisher#16 (thank you @dkuku).


Original issue was focused on a single new parser for YAML:
For better compatibility with posts from other static website builders.

@alfredbaudisch alfredbaudisch added documentation Improvements or additions to documentation enhancement New feature or request and removed documentation Improvements or additions to documentation labels Sep 18, 2021
@dkuku
Copy link

dkuku commented Sep 18, 2021

I've recently pushed a pr to nimble publisher to have an option for custom parser-do you think this can be done in a way thats compatible between the packages as a hex dependency?
dashbitco/nimble_publisher#16

@alfredbaudisch
Copy link
Owner Author

alfredbaudisch commented Sep 18, 2021

I liked your idea and the approach to dealing with the parsers. Having it as a hex dependency can be useful for PardallMarkdown, so I don't have to re-invent the wheel.

@dkuku
Copy link

dkuku commented Sep 18, 2021

The Code.eval_string trick may be good if you keep the data inside your app as nimble publisher does. But when you want to allow parsing external folders possibly modified by others it's a security threat.

@alfredbaudisch alfredbaudisch changed the title Add optional support for FrontMatter post metadata with YAML, instead of Elixir maps Add support for custom Parsers of Markdown metadata/attributes (for YAML, Joplin, etc); Make the current Elixir Map parser one of the parser options Sep 23, 2021
alfredbaudisch added a commit that referenced this issue Sep 23, 2021
…lement from `PardallMarkdown.MetadataParser`), initially with a parser for elixir maps (the default one) and one for Joplin notes.

- The parser can be chosen with the setting `:metadata_parser`.
- Removed `:should_try_split_content_title_from_first_line`, since it was specific only to Joplin notes and now the specific parser does not need it.

Part of #30 #32
@alfredbaudisch
Copy link
Owner Author

alfredbaudisch commented Sep 23, 2021

I've recently pushed a pr to nimble publisher to have an option for custom parser-do you think this can be done in a way thats compatible between the packages as a hex dependency?
dashbitco/nimble_publisher#16

@dkuku implemented as per your idea, thank you (a30a748)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants