Giter VIP home page Giter VIP logo

Comments (6)

uranusjr avatar uranusjr commented on May 22, 2024

The HUD window used by MultiMarkdown Composer seems nice. We might just implement a read-only (clickable) tree structure.

from macdown.

diethardsteiner avatar diethardsteiner commented on May 22, 2024

Sound great! The read-only clickable tree structure is the most important part for me.

from macdown.

masukomi avatar masukomi commented on May 22, 2024

I'd appreciate an optional clickable tree structure.

The HUD from MMC is nice too, but what I frequently end up wanting is

  • the ability to navigate between the headings in a large document
  • the ability to generate a TOC at the top of the document that links to the headers in the rest of the document.

Sadly the latter involves creating "<a name..." tags in the html for the "<a href..." tags to link to, and that's beyond the capabilities of a markdown parser that honors the spec (without getting ugly about your markdown code).

from macdown.

diethardsteiner avatar diethardsteiner commented on May 22, 2024

I am not too sure if you are ware of it, but there is already a TOC feature available by using the [TOC] syntax. I requested this in another issue some time ago.
The HUD TOC display I asked for here doesn't have anything to do with the output, so maybe we can keep these topics separate. Ideally I suggest creating a new issue if you require some additional functionality, just to keep the purpose of this issue clear/focused. Thanks!

from macdown.

aarononeal avatar aarononeal commented on May 22, 2024

I was hoping it would be straightforward to implement an NSOutlineView for the TOC but it looks like:

  1. This requires implementation of a custom hoedown renderer.
  2. There is no easy way to get the markdown line numbers back from hoedown to know where to scroll the document view to (short of counting lines for each render call that comes through).

Any thoughts on approach?

from macdown.

uranusjr avatar uranusjr commented on May 22, 2024

MacDown already uses a modified renderer for the main HTML content. As long as we don’t need to touch the parser it is perfectly fine to substitute something in Hoedown.

The second part is tricky. It used to be that Hoedown manipulates the input before processing it, so the original position is already lost before it reaches the renderer. I’m not sure whether it is still the case now though. Either way, it is currently very difficult (if not impossible) to implement this without serious hackery.

The people behind Hoedown is developing a version 4 that should resolve the issue, but that’s not nearly done as of now. My advice would be to just implement a read-only outline view for now, and maybe allow jumping to a header in preview. The rest can be filled in later.

(Also please, please don’t hesitate to lend a hand to Hoedown itself if you have an idea in C. It is a very nice library with very clean, readable source.)

from macdown.

Related Issues (20)

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.