-
Notifications
You must be signed in to change notification settings - Fork 17.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x/tools/cmd/godoc: Proposal: let godoc recognize mT styled source #35896
Comments
Every step toward Literate Programming is worthwhile. It will be interesting to see how others react to the use of characters beyond 1970s ASCII as formatting requests. In a proposal of my own about using such a character in an addition to ` in Go, the "those strange characters scare me" sentiment seemed pretty strong. |
fwiw: glyphs U+02DF and U+02B7 are not present in Go fonts |
Yes, WGL4 does not have them. This qualifies for "Open issues", thank you. |
I'm totally in favour for rendering numbered and bulletpoint lists better This proposal aims at too much. I think the current godoc formating lacks Headings, paragraphs are solved and work (not perfectly but they work). URLs can be detected reliably and I actually do like to see the URL of For b) it is hard to find some heuristic which works well for list existing Common wisdom for a) is to use backticks as in markdown. This is ugly,
Being rendered as "Foo foos (Just my contribution to this bikeshedding.) |
This would impose that the author has gotten intimate knowledge about how the used automat "thinks". Process of getting to this knowledge is painful and time consuming. (This "heuristic fallacy" now affects millions of markdDown and yaml users.)
Re-read mine's above ;) There are NO heuristics allowed in the marktop processor. Period. Every construct representable in marktop (the list item is one of) is introduced by a single rune and it usually ends where other of its kind begins. The specified hard rule imposes that any marktop introduced change surely ends at an empty line. No exceptions. Therefore a list is rendered only where intented:
Empty line ended the list. Indent above is not a part of the syntax (hence refferal to the gofmt in the go-focused part of the spec).
Marktop does not intent to interfere here. It just adds an identifier to the already recognized section, it allows any sentence to have a referral identifier added then used.
URLs are not to be detected with marktop. The paths are to be listed.
Backticks are part of the Go language specification and they may carry their meaning even in the prose. Eg. you should use raw string, ie. one in `backticks`. None of marktop proposed runes is a part of any programming language syntax (one I know of, at least). Marktop was designed with possible ambiguities in mind and aims to not introduce one.
Mhm... then let your editor software strip an ending one:
P.S. If you do like using space for formatting (and you are using graphical linux desktop on a PC), a short command: |
Closing this issue for now, until I address weaknesses pointed to me (on irc) mostly
And 5: I desperately need a name without "mark" in it. Two out of five participants were not ashamed to acknowledge that they did not read this proposal past the title because they “abhor the very word markDOWN”. I will, hopefully soon, open an improved version of this proposal. |
Proposal: let godoc recognize marktop styled source
Author: Ohir Ripe [Wojciech S. Czarnecki]
Last updated: 2019/11/28
Discussion at https://golang.org/issue/35896
Related to: #7873, #16666 and other "rich format please" issues.
Abstract
I propose using a ´marktop´ annotations within the ¨Go¨ source documentation. Marktop enrichment is unobtrusive even if read in the ˉraw sourceˉ. Did you notice marktop annotations? These would render:
I propose using a marktop annotations within the Go source documentation. Marktop enrichment is unobtrusive even if read in the
raw source
.Background
Current state of ¨Go¨'s source documentation processing is good enough for documenting single ´implemented ˘things˘, ie. functions, variables, constants. It falls short if one must convey a new idea, an unobvious implementation of an algorithm, or even just describe a sequence of events (no lists, sadly).
Proposal
I propose extending go doc processing by a marktop annotations parser implementing both console and html output of described below format. (note that example of keyboard mapping is irrelevant for this proposal).
Rationale
Documentation that can be styled even with only bold and italics, and one that can be structured to fit the domain, may help package authors to be more precise and unambigous, and help documentation consumers to avoid misunderstandings.
Marktop enabled godoc may encourage a well structured documentation that is written into the program sources even for, or the more for most sophisticated ideas, solutions and code. Now packages of even middle complexity often resort to external descriptions of their api.
Marktop parsing is fast, and there are no ambiguities introduced.
Unlike Markdown that makes raw annotated text almost unreadable, the marktop annotations are barely noticeable unless reader is wilfully scanning for the formatting hints.
Compatibility
This proposal extends documentation source syntax, and this syntax parsing methods, in a way that may not influence any program source but — in theory — might alter the visible html output of some existing documentation.
Even if this would happen, such a change would likely effect in the font decoration or size, and would not affect the meaning.
Implementation
None ideas yet.
Open issues
two proposed glyphs are not in the WGL4 set. WGL4 fortunately has, unfortunately
only two, runes that keeps to the top and fits purpose. Not as good as previous ˟ and ʷ,
but still unobtrusive:
The text was updated successfully, but these errors were encountered: