12e5b6d6dSopenharmony_ci---
22e5b6d6dSopenharmony_cilayout: default
32e5b6d6dSopenharmony_cititle: User Guide Editing
42e5b6d6dSopenharmony_cinav_order: 5
52e5b6d6dSopenharmony_ciparent: Contributors
62e5b6d6dSopenharmony_ci---
72e5b6d6dSopenharmony_ci<!--
82e5b6d6dSopenharmony_ci© 2020 and later: Unicode, Inc. and others.
92e5b6d6dSopenharmony_ciLicense & terms of use: http://www.unicode.org/copyright.html
102e5b6d6dSopenharmony_ci-->
112e5b6d6dSopenharmony_ci
122e5b6d6dSopenharmony_ci# Editing the ICU User Guide
132e5b6d6dSopenharmony_ci{: .no_toc }
142e5b6d6dSopenharmony_ci
152e5b6d6dSopenharmony_ci## Contents
162e5b6d6dSopenharmony_ci{: .no_toc .text-delta }
172e5b6d6dSopenharmony_ci
182e5b6d6dSopenharmony_ci1. TOC
192e5b6d6dSopenharmony_ci{:toc}
202e5b6d6dSopenharmony_ci
212e5b6d6dSopenharmony_ci---
222e5b6d6dSopenharmony_ci
232e5b6d6dSopenharmony_ci## Overview
242e5b6d6dSopenharmony_ci
252e5b6d6dSopenharmony_ciThis version of the ICU User Guide is generated directly from the Markdown
262e5b6d6dSopenharmony_cifiles in the `/docs` directory of the main repository. In particular, the
272e5b6d6dSopenharmony_ciMarkdown files are customized to work with the Jekyll static site generator,
282e5b6d6dSopenharmony_ciwhich benefits from [GitHub's built-in support](https://docs.github.com/en/github/working-with-github-pages/setting-up-a-github-pages-site-with-jekyll)
292e5b6d6dSopenharmony_cifor Jekyll sites.
302e5b6d6dSopenharmony_ci
312e5b6d6dSopenharmony_ci## How to Contribute
322e5b6d6dSopenharmony_ci
332e5b6d6dSopenharmony_ciBecause ICU User Guide source files are now contained within the main
342e5b6d6dSopenharmony_cirepository, changes can now be made through the same process for contributing 
352e5b6d6dSopenharmony_cicode patches. See [Contributions to the ICU Library](constributions.md) for the
362e5b6d6dSopenharmony_cicurrent process of filing an issue and submitting a pull request.
372e5b6d6dSopenharmony_ci
382e5b6d6dSopenharmony_ciIn the case of a single file edit (ex: typo correction), a convenient way to
392e5b6d6dSopenharmony_cicreate the pull request is to follow the "Edit this page on Github" link at
402e5b6d6dSopenharmony_cithe bottom of the page and [use GitHub to edit the file](https://docs.github.com/en/github/managing-files-in-a-repository/editing-files-in-your-repository)
412e5b6d6dSopenharmony_ciand create the new pull request.
422e5b6d6dSopenharmony_ci
432e5b6d6dSopenharmony_ciAfter the source branch for a potential pull request is made, the changes can 
442e5b6d6dSopenharmony_cibe previewed using the fork repository that contains the source branch.  The
452e5b6d6dSopenharmony_cifork repository must be [configured to serve GitHub Pages](https://docs.github.com/en/github/working-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#choosing-a-publishing-source)
462e5b6d6dSopenharmony_cifrom the branch and the Markdown pages root directory (`/docs`).
472e5b6d6dSopenharmony_ci> :point_right: **Note**:  there is a
482e5b6d6dSopenharmony_cilatency of several minutes before GitHub Pages renders new changes, and 
492e5b6d6dSopenharmony_ci[errors](https://docs.github.com/en/github/working-with-github-pages/about-jekyll-build-errors-for-github-pages-sites)
502e5b6d6dSopenharmony_ciprevent the changes from being rendered.
512e5b6d6dSopenharmony_ci
522e5b6d6dSopenharmony_ci## Jekyll Theme Configuration
532e5b6d6dSopenharmony_ci
542e5b6d6dSopenharmony_ciJekyll site-wide configurations are stored
552e5b6d6dSopenharmony_ciin the `_config.yml` file. The current theme being used is
562e5b6d6dSopenharmony_ci[Just the Docs](https://pmarsceill.github.io/just-the-docs/).
572e5b6d6dSopenharmony_ci
582e5b6d6dSopenharmony_ciDue to incompatibilities between this theme and GitHub’s built-in implementation of the
592e5b6d6dSopenharmony_ciCommonMark Markdown parser, the default Jekyll Markdown parser, Kramdown, is
602e5b6d6dSopenharmony_ciused.
612e5b6d6dSopenharmony_ci
622e5b6d6dSopenharmony_ci## Document Structure
632e5b6d6dSopenharmony_ci
642e5b6d6dSopenharmony_ciMajor chapters have Introduction pages, and further sections in a chapter are
652e5b6d6dSopenharmony_cisubpages of that main chapter page. The navigation bar is generated from the
662e5b6d6dSopenharmony_ciinformation provided in the header section of the Markdown file according to
672e5b6d6dSopenharmony_cithe theme's [navigation annotations](https://pmarsceill.github.io/just-the-docs/docs/navigation-structure/).
682e5b6d6dSopenharmony_ci
692e5b6d6dSopenharmony_ci## Syntax
702e5b6d6dSopenharmony_ci
712e5b6d6dSopenharmony_ci[Markdown](https://kramdown.gettalong.org/syntax.html) should be preferred over custom
722e5b6d6dSopenharmony_ciHTML to create content wherever possible.
732e5b6d6dSopenharmony_ci
742e5b6d6dSopenharmony_ci## Common Styles
752e5b6d6dSopenharmony_ci
762e5b6d6dSopenharmony_ciStyles are provided by the theme's settings, which can be modified in `_config.yml`.
772e5b6d6dSopenharmony_ci
782e5b6d6dSopenharmony_ci## Code
792e5b6d6dSopenharmony_ci
802e5b6d6dSopenharmony_ciUse the markdown notation of [single backtick](https://kramdown.gettalong.org/quickref.html#inline-code)
812e5b6d6dSopenharmony_cicode spans (inline) and [tilde line-demarcated](https://kramdown.gettalong.org/quickref.html#code-blocks)
822e5b6d6dSopenharmony_cifenced code blocks (multi-line).
832e5b6d6dSopenharmony_ci
842e5b6d6dSopenharmony_ciUnlike Github-flavored Markdown, in multi-line fenced code
852e5b6d6dSopenharmony_ciblocks, the programming language in the [info string](https://spec.commonmark.org/0.29/#info-string)
862e5b6d6dSopenharmony_cishould be lowercased.
872e5b6d6dSopenharmony_ci
882e5b6d6dSopenharmony_ci## Notes
892e5b6d6dSopenharmony_ci
902e5b6d6dSopenharmony_ci> :point_right: **Note**: Notes should be made by starting the line with the
912e5b6d6dSopenharmony_cifollowing Markdown:
922e5b6d6dSopenharmony_ci
932e5b6d6dSopenharmony_ci~~~
942e5b6d6dSopenharmony_ci> :point_right: **Note**:
952e5b6d6dSopenharmony_ci~~~
962e5b6d6dSopenharmony_ci
972e5b6d6dSopenharmony_ci## TODOs
982e5b6d6dSopenharmony_ci
992e5b6d6dSopenharmony_ci"TODO" items should be marked by starting the line with the
1002e5b6d6dSopenharmony_cifollowing Markdown:
1012e5b6d6dSopenharmony_ci
1022e5b6d6dSopenharmony_ci~~~
1032e5b6d6dSopenharmony_ci> :construction: **TODO**:
1042e5b6d6dSopenharmony_ci~~~
1052e5b6d6dSopenharmony_ci
1062e5b6d6dSopenharmony_ciThis will result in a "TODO" item like this:
1072e5b6d6dSopenharmony_ci
1082e5b6d6dSopenharmony_ci> :construction: **TODO**: Adjust this page for use of GitHub Markdown (since 2020)
1092e5b6d6dSopenharmony_ci
1102e5b6d6dSopenharmony_ci## Emoji
1112e5b6d6dSopenharmony_ci
1122e5b6d6dSopenharmony_ciGitHub-flavored emoji are enabled using the
1132e5b6d6dSopenharmony_ci[Jemoji](https://github.com/jekyll/jemoji) Ruby gem.
1142e5b6d6dSopenharmony_ci
1152e5b6d6dSopenharmony_ci## Bookmarks & Links
1162e5b6d6dSopenharmony_ci
1172e5b6d6dSopenharmony_ciFor internal links, please used relative paths to the corresponding Markdown 
1182e5b6d6dSopenharmony_cifile as the Markdown link path rather than specifying the full URL.
1192e5b6d6dSopenharmony_ci
1202e5b6d6dSopenharmony_ciAnchors are generated by Jekyll for sections using the section header text in
1212e5b6d6dSopenharmony_cilowercase with hyphens instead of spaces.
1222e5b6d6dSopenharmony_ci
1232e5b6d6dSopenharmony_ci> :construction: **TODO**: search our pages for "(§)" and fix the links.
1242e5b6d6dSopenharmony_ci
1252e5b6d6dSopenharmony_ci## Previewing Changes Locally
1262e5b6d6dSopenharmony_ci
1272e5b6d6dSopenharmony_ciBecause of the latency in GitHub Pages rendering changes, it can be useful to 
1282e5b6d6dSopenharmony_cirun a Jekyll instance locally to preview changes.
1292e5b6d6dSopenharmony_ci
1302e5b6d6dSopenharmony_ci### Setup
1312e5b6d6dSopenharmony_ci
1322e5b6d6dSopenharmony_ciGitHub Pages provides a list of
1332e5b6d6dSopenharmony_ci[dependency versions](https://pages.github.com/versions/) used in order
1342e5b6d6dSopenharmony_cito allow local environments to match exactly. Since Jekyll is a Ruby project,
1352e5b6d6dSopenharmony_cisetup details depend on gems (code packages), Bundler (dependency management for
1362e5b6d6dSopenharmony_ciexecution), and the version of Ruby.
1372e5b6d6dSopenharmony_ci
1382e5b6d6dSopenharmony_ci[rbenv](https://www.ruby-lang.org/en/documentation/installation/#rbenv) is one
1392e5b6d6dSopenharmony_ciof the few different ways to install and control the version of Ruby.  To 
1402e5b6d6dSopenharmony_ciinstall it and the required `ruby-build` plugin:
1412e5b6d6dSopenharmony_ci```bash
1422e5b6d6dSopenharmony_cigit clone https://github.com/rbenv/rbenv.git ~/.rbenv
1432e5b6d6dSopenharmony_cicd ~/.rbenv && src/configure && make -C src # Optional but greatly speeds up certain operations
1442e5b6d6dSopenharmony_ciecho 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
1452e5b6d6dSopenharmony_ci```
1462e5b6d6dSopenharmony_ci```bash
1472e5b6d6dSopenharmony_cimkdir -p "$(rbenv root)"/plugins
1482e5b6d6dSopenharmony_cigit clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
1492e5b6d6dSopenharmony_ci```
1502e5b6d6dSopenharmony_ci
1512e5b6d6dSopenharmony_ciTo install specific Ruby version that GitHub Pages uses:
1522e5b6d6dSopenharmony_ci```bash
1532e5b6d6dSopenharmony_cirbenv versions  # list all Ruby versions available
1542e5b6d6dSopenharmony_cirbenv install <version-num>  # install GH Pages Ruby version
1552e5b6d6dSopenharmony_cirbenv versions  # list all Ruby versions after installing
1562e5b6d6dSopenharmony_ci```
1572e5b6d6dSopenharmony_ci
1582e5b6d6dSopenharmony_ciTo activate the version of Ruby:
1592e5b6d6dSopenharmony_ci```bash
1602e5b6d6dSopenharmony_cirbenv init  # OR:  eval "$(rbenv init -)"
1612e5b6d6dSopenharmony_cirbenv shell <version-num>
1622e5b6d6dSopenharmony_cirbenv versions  # verify the specified version is in use
1632e5b6d6dSopenharmony_ci```
1642e5b6d6dSopenharmony_ci
1652e5b6d6dSopenharmony_ciTo install [Bundler](https://bundler.io/):
1662e5b6d6dSopenharmony_ci```bash
1672e5b6d6dSopenharmony_cigem install bundler
1682e5b6d6dSopenharmony_ci```
1692e5b6d6dSopenharmony_ci
1702e5b6d6dSopenharmony_ciThe simplest way to ensure that
1712e5b6d6dSopenharmony_citransitive dependency versions are included correctly is to just specify the
1722e5b6d6dSopenharmony_ci`github-pages` gem. This is already configured in `Gemfile` in the root
1732e5b6d6dSopenharmony_cidirectory. Thus, to ensure that the Ruby shell has the correct versions of
1742e5b6d6dSopenharmony_cidependencies downloaded and cached, in the root directory (`/docs`), run:
1752e5b6d6dSopenharmony_ci```bash
1762e5b6d6dSopenharmony_cicd <ICU>/docs  # change to User Guide docs root directory
1772e5b6d6dSopenharmony_cibundle update
1782e5b6d6dSopenharmony_ci```
1792e5b6d6dSopenharmony_ci
1802e5b6d6dSopenharmony_ci### Running
1812e5b6d6dSopenharmony_ci
1822e5b6d6dSopenharmony_ciEnsure that the specific version of Ruby has been activated. Then use Bundler
1832e5b6d6dSopenharmony_cito ensure that the dependencies are downloaded in the current Ruby "shell"
1842e5b6d6dSopenharmony_ciinstance.  Then use Bundler to execute the Jekyll server.
1852e5b6d6dSopenharmony_ci```bash
1862e5b6d6dSopenharmony_cirbenv init  # OR:  eval "$(rbenv init -)"
1872e5b6d6dSopenharmony_cirbenv shell <version-num>
1882e5b6d6dSopenharmony_cicd <ICU>/docs  # change to User Guide docs root directory
1892e5b6d6dSopenharmony_cibundle update
1902e5b6d6dSopenharmony_cibundle exec jekyll server
1912e5b6d6dSopenharmony_ci```
1922e5b6d6dSopenharmony_ci
1932e5b6d6dSopenharmony_ciJekyll will take several seconds to generate HTML from the Markdown, so the
1942e5b6d6dSopenharmony_ciJekyll server will wait for that before being ready. Then, the rendered pages
1952e5b6d6dSopenharmony_ciwill be available at <http://localhost:4000/icu/>.
1962e5b6d6dSopenharmony_ci
1972e5b6d6dSopenharmony_ci## Previous version
1982e5b6d6dSopenharmony_ci
1992e5b6d6dSopenharmony_ciThe previous version of the ICU User Guide has been maintained via Google Sites. The Site
2002e5b6d6dSopenharmony_ciaddress is <http://sites.google.com/site/icuprojectuserguide/>
201