Comments (2)
- Import messages within code-block markup, to render it literally:
One nice aspect of this is that bpo issues are currently displayed monospace. Without adequate conversion of code blocks such as in (3), code snippets and places where alignment is important would look broken. (3) seems quite hard to implement though, a lot of the formatting is ad-hoc (I know I've personally sometimes kept code blocks on the same level or indented them with 2 or 4 spaces occasionally). It seems like (1) might be the way to go. If we really want (2) there are mature libraries like turndown.
On bpo, links to other issues, messages, PRs, PEPs, etc. are added at rendering time using regexes.
This is probably less of a concern with https://docs.github.com/en/github/administering-a-repository/managing-repository-settings/configuring-autolinks-to-reference-external-resources which we already have set up for bpo links on the CPython repo thanks to @Mariatta in python/core-workflow#361
Issues numbers can also be remapped from the bpo to the GH numbers during the same step.
Depending on the resolution to #2, it might be nice to keep the links the same and then the bugs.python.org/issuexxx
links end up redirecting you to the right Github page. But assuming we make the roundup instances read-only or mirrored then remapping the issues is probably a good idea.
from gh-migration.
We have:
- raw text, possibly including markdown characters
- explicit links like https://bugs.python.org/issue2771 in the msg body
- implicit links like these added while rendering the msg on bpo
We want:
- to keep the plain text as plain, possibly non-monospaced, with markdown characters escaped
- explicit links to be clickable
- implicit links to be clickable
- code, tracebacks, terminal sessions, output to be monospaced, possibly highlighted
It seems that:
- <pre> or ```...``` can be used to show the code in a monospaced block:
-
the background looks different and
-
explicit links like https://bugs.python.org/issue2771 are not clickable
-
this also doesn't work [these](https://bugs.python.org/issue2771#msg154050)
-
and neither does #3
-
- <samp> can be used to make the text monospaced:
- like this
- links like https://bugs.python.org/issue2771 work
- this and #3 work too
- but all other MarkDown characters are also interpreted
- also leading spaces are stripped...
- ...unless replaced with
- each paragraph must also be wrapped by a separate <samp>
- All ASCII punctuation can be escaped
- this will prevent things like __init__ turning into init
- however this will break links too
- File links in traceback will be lost if use ```...``` to get syntax highlight, but can be preserved if we use <samp> (with no highlight)
If we want to implement option 2 from the first message, we could:
- wrap each paragraph in <samp>
- replace leading whitespace with
- escape all punctuation (except in URLs)
This should make the messages look similar to bpo: monospaced, no fancy markup/highlight, with working links.
If we want to implement option 3, we could parse each paragraph independently and:
- if it seems mostly text, only escape all punctuation (except in URLs)
- if it looks like code, wrap it within ```...``` to have a monospaced font
- this will break all links in the block, including ones in tracebacks
- for code highlight, we could:
- just use
py
by default for all blocks - use a simple heuristic (e.g. contain
>>>
/ keywords likedef
) to detect Python, usetext
otherwise - use pygment to detect the lang
- only Python/C/rst should be allowed, the rest should be
text
- might be a bit slow
- only Python/C/rst should be allowed, the rest should be
- just use
- we might also be able to detect and allow some additional markup, like `...` or *...*, or perhaps even lists, and leave it unescaped
- making this undoable and/or storing the raw message somewhere shouldn't be an issue, since we can always get the original messages from bpo if we ever need them
I'll do some tests on a real world sample to see if we can reach a good compromise.
from gh-migration.
Related Issues (20)
- Issue (re)numbering HOT 9
- Replace the local_replace.py script HOT 1
- Map bpo users to GitHub users HOT 15
- Notify bpo users once the migration is done HOT 12
- Migration and risk management plans HOT 2
- Make bpo read-only HOT 3
- Add links from bpo to GitHub
- Set up autonosy on labels HOT 2
- Add a page that redirects from bpo to GitHub HOT 3
- Fate of Roundup and the instances HOT 1
- Some GH PR references were not ported correctly HOT 19
- Subversion revisions references were not ported HOT 6
- Archive bpo-related repos HOT 6
- Write a tool to export data from bpo HOT 1
- Map bpo issue metadata to GitHub fields/labels HOT 7
- Replace the weekly summary report HOT 20
- Replace the sendmail script HOT 13
- Replace the irker detector HOT 3
- Replace the stats page HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gh-migration.