Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mdx - Template Markdown #11

Open
alikindsys opened this issue Nov 13, 2022 · 0 comments
Open

mdx - Template Markdown #11

alikindsys opened this issue Nov 13, 2022 · 0 comments
Labels
being worked upon enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed invalid This doesn't seem right

Comments

@alikindsys
Copy link
Owner

alikindsys commented Nov 13, 2022

Markdown is amazing, but one thing that is a constant pain on it is having neatly formatted documents, it would be nice if markdown had support for templates on itself, and that includes advanced latex support. Say for example i'd want to write an chemical equation with chemfig, or draw a molecule from a smiles specification using latex.

The main design is to have a core that parses and generates latex code from two files (i'm copying what latex does with .sty and .tex files, but in a much more cleaner design (i personally hate backslash syntax))

this will require the creation of an abstracted parsing library cause parser combinators are just too easy.

mdx - Mardown Extension

Script files that provide functions that parse text elements. The core mardown parser would be written in one of those.

#[mark(std)]
mod markdown;
exports {bold, italic, ...}
import {into, bold} from utils 
matchrules = rules! {
      __bold |> __italic |> end
}


meta __bold(text: Seq[char]) {
    ["**", char, "**"] into "${proc!(char)}".bold()
}

meta __italic(text: Seq[char]) {
  ["*", char, "*"] into "${proc!(char)}".italic(),
  ["_", char, "_"] into "${proc!(char)"}.italic()
}

/// A More interesting parser, urls.
meta __url(text: Seq[char]) {
  ["[", text, "]", "(", url, ")"] into link!(url, proc!(text?)) 
}

meta __image(text: Seq[char]){
  ["!", (\x -> __url(x)) as url ] into url.withMeta(metadata::Image)
}

xmd - eXtended Markdown

The files that will be compiled into latex.

@alikindsys alikindsys added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers invalid This doesn't seem right being worked upon labels Dec 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
being worked upon enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

1 participant