Giter VIP home page Giter VIP logo

markdown2wl's People

Contributors

dishmint avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

rohitn ewandawson

markdown2wl's Issues

Write test.md from scratch

Forego the use of the 'exhibit of markdown' example markdown page and write one up from scratch. It will be much easier to assess the effectiveness of the parse with succinct examples.

Add MarkdownLexer tests

With MarkdownLexer implemented, I should make sure a comprehensive set of tests are added.

CopyAsMarkdown

Add CopyAsMarkdown menu item so one can copy a cell into markdown formatted text

Verify Parser Tests

The parser tests need to be verified. I constructed them by running ImportMarkdown on the test input from the markdown field in the commonmark v0.30 JSON tests. There's no guarantee they are correct right now. A brief look at some of the initial tests suggests they probably all are not correct. (or at least not expected)

Support HTML

Recognize HTML and parse as HTMLElements.

It may be as simple as detecting the html snippets and importing them as symbolic HTML.

Implement MarkdownParser

The parser refines tokens into their final symbolic form

  • Parser
    • Emphasis (Italics, Bold, InlineCode, LaTex)
    • Blocks (CodeBlock, Tables, Lists)
    • Links (Hyperlinks, Footnotes, Images)

Custom Markdown Stylesheets

In the default stylesheet item indentation is limited, so I think this warrants a custom stylesheet.

Stylesheets to reference:

  • Outline

Don't hardcode indentation-length for space characters in regex rules

The \\s{2} could be a problem if people use different indentation-lengths.

(* OrderedListItems *)
    RegularExpression[ "^((\\s{2}|\\t)*)((\\d\\.)+\\d?)\\s(.*)$" ] :> $TokenLevelData[ <| "Token" -> "OrderedListItem", "Level" -> GetIndentationLevel["$1"], "Data" -> "$5" |> ]

There are three possibilities: (1) set the indentation-length with an option, (2) set the indentation-length per flavor, or (3) normalize all leading indentation to spaces or tabs

ExtractFootnoteURL mysteriously Privated

For some reason ExtractMarkdownFootnoteURL enters the Private context when extracting the 3rd footnote from test.md

 First[Private`ExtractMarkdownFootnoteURL[3, Private`footFile]]]
MarkdownElement["Item",
    <|
        "Type" -> "Unordered",
        "IndentationLevel" -> 0,
        "IndentationType" -> None, 
        "Content" -> {
                "A named link to",
                MarkdownElement[Hyperlink, "MarkItDown", First[Private`ExtractMarkdownFootnoteURL[3, Private`footFile]]], 
                ". The easiest way to do these is to select what you want to make a link and hit ",
                MarkdownElement["InlineCode", "Ctrl+L"], "."
                }
    |>
]

Ordered sub items with d.d form not parsing as items in VerificationTest

Parser test failure

TestID:

OrderedItemTest2

Input:

"  1.1 here is an ordered sub item"

Expected:

MarkdownElement["Item",
    Association[
        "Type" \[Rule] "Ordered", "IndentationLevel" \[Rule] 1,
        "IndentationType" \[Rule] "Whitespace",
        "Content" \[Rule] "here is an ordered sub item"
    ]
]

Output:

"  1.1 here is an ordered sub item"

Ensure Rules Conform to CommonMark

Here's the link to CommonMark .30 tests

An example test:

VerificationTest[
    ImportMarkdown["< test string >"],
    ...
]

I should also note the version being tested, I could do that in the TestID, or have different test files for different CommonMark versions.

Handle rendering by stylesheet instead of MarkdownExpression-StyledExpression conversion

In exporting Markdown I wonder if it makes sense to keep the Markdown in Symbolic form. Converting the Markdown expressions to Styled expressions obfuscates the markdown expressions, or adds fluff to it? I'm considering including a stylesheet, that way on the export mechanism just needs to interface with the symbolic markdown, rather than the 'rendered' expressions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.