Git Product home page Git Product logo

Comments (6)

fletcher avatar fletcher commented on June 27, 2024

I'm not entirely dissatisfied with the way abbreviations work in MMD-5, however the algorithm to replace them will need to be modified. There are two general options:

  1. Read the document to find all abbreviation definitions, then scan the document for all uses of the abbreviation, and replace it with the appropriate syntax. Advantage -- automatically identifies all uses of the abbreviation without user action. Disadvantage -- requires scanning the entire document for each occurrence of each defined abbreviation. In MMD-5, this meant that 10 abbreviations would require scanning almost every word of the document 10 times. I've now worked on some code that could check for all 10 abbreviations in a single pass, but would still be a bit messy.

  2. Require the author to "tag" each use of the abbreviation that they desire to be handled. Each abbreviation would still only have to be defined once, but this would require more effort when writing or revising the document. Advantage -- much more efficient, since abbreviations would be identified during the usual parse process, just like links and footnotes. Disadvantage -- it becomes possible for an author to forget to take some uses of an abbreviation.

I welcome thoughts and input on this feature!

from multimarkdown-6.

nemesit avatar nemesit commented on June 27, 2024

I think the single pass scan beats option 2.

from multimarkdown-6.

fletcher avatar fletcher commented on June 27, 2024

As I think about this (and after re-implementing glossary support), I think that I will do a few things re: abbreviations:

  1. The syntax will fall more in line with footnotes, citations, and now abbreviations -- something along the lines of the [xfoo] where x is some punctuation character.

  2. The approach used for glossary items that requires tagging each use makes a lot of sense from a performance standpoint. Comparing each word in the document to an abbreviation list is expensive. And, because of the way MMD-6 is optimized for performance, it is a bit tricky.

  3. What might make sense for automated identification of abbreviations within the text would be a separate (optional) stage that takes the identified list of abbreviations and automatically wraps each instance in the [xfoo] syntax before re-processing the document.

  4. For those wanting "easy" -- give MMD a bit more time, and it will automatically identify each occurrence of abbreviations (and glossary terms?). If you need performance -- then each instance should be marked in advance, and MMD will use it's normal fast approach.

from multimarkdown-6.

fletcher avatar fletcher commented on June 27, 2024

I think the new abbreviation syntax is better than the old one. There may still be room for some improvement.

See https://github.com/fletcher/MultiMarkdown-6/wiki/Changes-from-MMD-5 for more information.

from multimarkdown-6.

mn4367 avatar mn4367 commented on June 27, 2024

The new syntax is nice but I'd like to vote for some sort of compatibility mode (command line switch, metadata key) which enables automatic identification of abbreviation and glossary terms. I'd happily accept the performance penalty.

from multimarkdown-6.

fletcher avatar fletcher commented on June 27, 2024

That was always on the list, and has been added this evening. Abbreviations and glossary terms are now automatically identified.

from multimarkdown-6.

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.