Skip to content
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

Add typographic punctuation #1942

Merged
merged 1 commit into from
Jan 30, 2021
Merged

Conversation

tunetheweb
Copy link
Member

@tunetheweb tunetheweb commented Jan 30, 2021

Fixes #1485

This converts simple quotes (" and ') to typographic quotes (“,”, and ‘’), sometimes know as curly quotes or smart quotes.

It does this using the smartypants library. I tried a few of these, and this one was the only one I could get working consistently as it ignores code formatting and comments.

Still needs a little fudging for our Jinja2 macros (figure markup) but actually quite clean.

I also fixed a lot of captions and descriptions to allow them to be typographic quotes too.

Currently it only handles English punctuation so translations for languages with different punctuation marks still need to convert.

@tunetheweb tunetheweb added development Building the Almanac tech stack design Creating the Almanac UX labels Jan 30, 2021
@tunetheweb tunetheweb added this to the 2020 Backlog milestone Jan 30, 2021
@tunetheweb
Copy link
Member Author

OK not surprising that template changes are too big with this, so going to ignore that failed test as that's the reason it failed.

@tunetheweb tunetheweb merged commit 146ae3b into main Jan 30, 2021
@tunetheweb tunetheweb deleted the typographic-punction-generation branch January 30, 2021 16:22
chefleo added a commit to chefleo/almanac.httparchive.org that referenced this pull request Feb 1, 2021
* upstream/main: (70 commits)
  Do fuller HTML linting checks on generated HTML (HTTPArchive#1959)
  Extend height of AMP Stories images (HTTPArchive#1957)
  Change Introductie to Inleiding (HTTPArchive#1956)
  Bump peter-evans/create-pull-request from v3.7.0 to v3.8.0 (HTTPArchive#1955)
  Update Timestamps and Generate Ebooks (HTTPArchive#1953)
  Update total number of pages in ebook to 600! (HTTPArchive#1952)
  Remove control characters causing HTML validation errors (HTTPArchive#1951)
  2020 javascript japanese translation (HTTPArchive#1937)
  Translation of 2020 accessibility chapter to Japanese (HTTPArchive#1949)
  Fix figure links and footnotes for ebook (HTTPArchive#1950)
  Fix hide description bug (HTTPArchive#1948)
  Update Timestamps and Generate Ebooks (HTTPArchive#1947)
  Smart Quotes for English non-chapter pages (HTTPArchive#1946)
  Typographical quotes for metadata (HTTPArchive#1945)
  Fix figure number bug (HTTPArchive#1944)
  Update Timestamps and Generate Ebooks (HTTPArchive#1943)
  Revert "Revert "Add typographic punction conversion"" (HTTPArchive#1942)
  Add Nuxt and Docusauraus to Jamstack 2020 chapter (HTTPArchive#1938)
  Revert "Add typographic punction conversion"
  Add typographic punction conversion
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design Creating the Almanac UX development Building the Almanac tech stack
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use of typographic quotes or "smart quotes" in the Web Almanac
1 participant