MarkdownD can easily handle all your markdown needs:Supports export to PDFSupports printingSupports standard Markdown/CommonMark and GFM (GitHub)-flavored markdownLive preview supportSupports ToC (Table of Contents), Emoji expressions, TaskLists (task map), and @Links (link)Supports decoding.
![]() Latest version ![]()
Released:
No project description provided
Project description
will apply black on python code automatically.
table is not implemented yet
Release historyRelease notifications
0.0.4
0.0.3
0.0.2
0.0.1
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Hashes for markdown_formatter-0.0.4-py3-none-any.whl
![]() Hashes for markdown_formatter-0.0.4.tar.gz
Markdown implementationZulip has a special flavor of Markdown, currently called ‘bugdown’after Zulip’s original name of “humbug”. End users are using Bugdownwithin the client, not original Markdown.Zulip has two implementations of Bugdown.
The backend implementationat zerver/lib/bugdown/ is based onand is used toauthoritatively render messages to HTML (and implementsslow/expensive/complex features like querying the Twitter API torender tweets nicely). The frontend implementation is in JavaScript,based on( static/js/echo.js), and is used to preview and locally echomessages the moment the sender hits enter, without waiting for roundtrip from the server. Those frontend renderings are only shown to thesender of a message, and they are (ideally) identical to the backendrendering.The JavaScript markdown implementation has a function,markdown.containsbugdown, that is used to check whether a messagecontains any syntax that needs to be rendered to HTML on the backend.If markdown.containsbugdown returns true, the frontend simply won’techo the message for the sender until it receives the rendered HTMLfrom the backend.
If there is a bug where markdown.containsbugdownreturns false incorrectly, the frontend will discover this when thebackend returns the newly sent message, and will update the HTML basedon the authoritative backend rendering (which would cause a change inthe rendering that is visible only to the sender shortly after amessage is sent). As a result, we try to make sure thatmarkdown.containsbugdown is always correct. TestingThe Python-Markdown implementation is tested byzerver/tests/testbugdown.py, and the marked.js implementation andmarkdown.containsbugdown are tested byfrontendtests/nodetests/markdown.js. A shared set of fixed test data(“test fixtures”) is present in zerver/fixtures/bugdown-data.json,and is automatically used by both test suites; as a result, it thepreferred place to add new tests for Zulip’s markdown system.If you’re going to manually test some changes in the frontend Markdownimplementation, the easiest way to do this is as follows:.
Login to your development server. Stop your Zulip server with ctrl-C, leaving the browser open. Compose and send the messages you’d like to test.
They will belocally echoed using the frontend rendering.This procedure prevents any server-side rendering. If you don’t dothis, backend will likely render the Markdown you’re testing and swapit in before you can see the frontend’s rendering. Zulip’s Markdown philosophyNote that this discussion is based on a comparison with the originalMarkdown, not newer Markdown variants like CommonMark.Markdown is great for group chat for the same reason it’s beensuccessful in products ranging from blogs to wikis to bug trackers:it’s close enough to how people try to express themselves when writingplain text (e.g. Emails) that it helps more than getting in the way.The main issue for using Markdown in instant messaging is that theMarkdown standard syntax used in a lot of wikis/blogs has nontrivialerror rates, where the author needs to go back and edit the post tofix the formatting after typing it the first time.
While that’sbasically fine when writing a blog, it gets annoying very fast in achat product; even though you can edit messages to fix formattingmistakes, you don’t want to be doing that often. There are basically2 types of error rates that are important for a product like Zulip:. What fraction of the time, if you pasted a short technical emailthat you wrote to your team and passed it through your Markdownimplementation, would you need to change the text of your email for itto render in a reasonable way? This is the “accidental Markdownsyntax” problem, common with Markdown syntax like the italics syntaxinteracting with talking about char.s. What fraction of the time do users attempting to use a particularMarkdown syntax actually succeed at doing so correctly?
Syntax likerequired a blank line between text and the start of a bulleted listraise this figure substantially.Both of these are minor issues for most products using Markdown, butthey are major problems in the instant messaging context, because onecan’t edit a message that has already been sent and users aregenerally writing quickly. Zulip’s Markdown strategy is based on theprinciples of giving users the power they need to express complicatedideas in a chat context while minimizing those two error rates. Basic syntax. Enable nl2br extension: this means one newline creates a linebreak (not paragraph break). Allow only. syntax for italics, not.
This resolves an issue wherepeople were using and hitting it by mistake too often. Asteriskssurrounded by spaces won’t trigger italics, either (e.g. With stock MarkdownYou should use char. instead of void. there would produce undesiredresults). Allow only. syntax for bold, not (easy to hit by mistake ifdiscussing Python init or something).
Add syntax for strikethrough. Disable special use of to escape other syntax. Rendering as was hugely controversial, but having no escape syntax is alsocontroversial. We may revisit this. For now you can always putthings in code blocks.
![]() Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
January 2023
Categories |