commit | 6cc8e58a83412dc31de6fb7614fadb0b51748d4b | [log] [tgz] |
---|---|---|
author | Dirk Pranke <dpranke@google.com> | Fri Feb 24 00:46:34 2023 |
committer | Copybara-Service <copybara-worker@google.com> | Fri Feb 24 00:53:39 2023 |
tree | fb2f554f44a07cfe93c9540afa786d87c0f53a79 | |
parent | 3180843cd29f28d458b5dcb3a0575a8f7625b826 [diff] |
Switch //tools/md_browser to use cipd. There are two standalone markdown-parsing tools in the repo, one in //tools/md_browser and the other in //net/tools/net_docs. Each uses a checked-in third-party copy of the Python markdown library (two different versions). Best practice these days for handling third-party packages of Python code is to use CIPD if you can; this tightens up the provenance better, hides the dependencies from the calling code, and allows the calling code to just import the library directly without doing any sys.path hacking. We can't use CIPD to remove both uses of the library, as one of the two uses happens during the build, and we're not allowed to use vpython as a build action. This change is motivated by crbug.com/14038, where we upgraded //third_party/Python-Markdown from v3.3.4 to v3.4.1, but we missed that the new version added a dependency on `importlib-metadata`. Using CIPD packages would've caught that. This CL switches md_browser to use vpython and CIPD, and removes one of the two checked-in copies. Bug: 140398 Change-Id: I583603e4c1318019b1b15391f52f989f4f8545f5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4283145 Reviewed-by: Ben Pastene <bpastene@chromium.org> Reviewed-by: Bruce Dawson <brucedawson@chromium.org> Commit-Queue: Dirk Pranke <dpranke@google.com> Cr-Commit-Position: refs/heads/main@{#1109359} NOKEYCHECK=True GitOrigin-RevId: 2983b3e42e6356ef5c9af903bf2c4a484aca7de6
This is a simple tool to render the markdown docs in a chromium checkout locally. It is written in Python and uses the Python ‘markdown’ package, which is checked into src/third_party.
md_browser attempts to emulate the flavor of Markdown implemented by Gitiles.
Gitiles is the source browser running on https://chromium.googlesource.com, and can be run locally, but to do so requires a Java install and a Buck install, which can be slightly annoying to set up on Mac or Windows.
This is a lighterweight solution, which also allows you to preview uncommitted changes (i.e., it just serves files out of the filesystem, and is not a full Git repo browser like Gitiles is).
To run md_browser:
cd to the top of your chromium checkout
run python3 tools/md_browser/md_browser.py
There is no step three.
This will run a local web server on port 8080 that points to the top of the repo. You can specify a different port with the -p
flag.