Code Monkey home page Code Monkey logo

Comments (7)

chriskuehl avatar chriskuehl commented on September 26, 2024

There doesn't seem to be a good syntax for adding anchors in any Markdown flavor :\

The closest is PHP Markdown Extra: https://michelf.ca/projects/php-markdown/extra/#spe-attr

Does this look like a reasonable syntax? Basically doing...

### 4.1.1.1 Date of Elections Meeting    {amended_321_1990}

alternatively something like this (in its own paragraph):

[[!anchor "amended_321_1990"]]

(similar to the meta syntax we adopted from ikiwiki)

from ocfweb.

nattofriends avatar nattofriends commented on September 26, 2024

So you have to extend the markdown parser to support this or...?

from ocfweb.

chriskuehl avatar chriskuehl commented on September 26, 2024

@nattofriends yes. or enable HTML, which I'd rather not just for this... (plus we can potentially export our constitution from markdown -> PDF or something if we want)

there seems to be no standard Markdown syntax for this :\

We already assign ids to headers like #h5_412-special-general-meetings but these are automatic based on the header name and might be easy to accidentally break, hence the desire for manually-named anchors.

from ocfweb.

jvperrin avatar jvperrin commented on September 26, 2024

Looks like a Mistune lexer would work well for this usage case, since we are essentially just adding a single rule so that anchor tags can be added. We are already using some in the markdown.py file, so you probably all knew this already. 😛

from ocfweb.

chriskuehl avatar chriskuehl commented on September 26, 2024

Yeah, mistune is pretty easy to extend. I was hoping we could at least find a commonly-used Markdown syntax rather than inventing our own again though, even if we have to extend mistune to support it :(

from ocfweb.

kpengboy avatar kpengboy commented on September 26, 2024

from ocfweb.

chriskuehl avatar chriskuehl commented on September 26, 2024

done in 4d27dda

from ocfweb.

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.