add real html2markdown.py code
1 file changed
tree: 301860a359b00e80e2a693daa02c793a7100f122
  1. scripts/
  2. site/
  3. third_party/
  4. .eleventy.js
  5. .firebaserc
  6. .gclient
  7. .gitignore
  8. DEPS
  9. firebase.json
  10. npmw
  11. package-lock.json
  12. package.json
  13. README.md
README.md

Exporting chromium.org to a static website.

So far these instructions have only been tested to run on a Mac, but should work on Linux and Windows with only a modicum of hoop-jumping.

  1. Install depot_tools:

    $ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
    $ export PATH=/path/to/depot_tools:$PATH
    
  2. Check out the repo:

    $ git clone https://chromium.googlesource.com/experimental/chromium_website
    
  3. cd into the checkout and download any dependencies:

    $ cd chromium_website
    $ gclient sync
    

    Note that there is a //.gclient file checked in, so you don't need to run gclient config or have a .gclient file in a directory above the website.

  4. Optional: Refresh the content from Classic Sites via the public GData APIs.

    ./scripts/export.py
    

    This downloads all of the HTML pages and converts them to Markdown, and also fetches any associated assets (images, attachments, etc.).

    export caches the metadata and HTML from Sites locally in the //export/feeds directory (but not images or other assets). This is useful when you need to iterate on the HTML->Markdown conversion or other changes where the raw data isn't likely to be needed. To force the script to explicitly re-fetch things, use the --force flag.

    NOTE: The HTML->Markdown logic is currently just a placeholder stub function, and you'll get the same HTML out that you feed into it. The actual conversion code used to generate the files in //site are not yet open source.

  5. Optional: Build all of the static pages up-front to check for errors. The content will be built into //build by default.

    $ ./npmw build
    
  6. Start a local web server to view the site. The server will (re-)generate the pages on the fly as needed if the input or conversion code changes. The content will be built into //build.

    $ ./npmw watch
    
  7. Optional: If you have the access to do so, you can deploy new versions to [chromium-website-experiment.web.app][https://chromium-website-experiment.web.app]:

    $ ./npmw deploy