Commit Graph

161 Commits

Author SHA1 Message Date
Annaheim.h@gmail.com bd934475b9 [docs] Update Screenshot in "Getting Started with Rails"
Replace the existing screenshot with the output produced in Rails 7. The current screenshot
seems to be captured in a previous version.
2024-01-15 18:43:26 +09:00
Alysson Rosa 937b307e84 Fixing fetch image on 'back-to-top' button 2023-06-01 09:53:39 -03:00
Alysson Rosa 22397bec6f Adding the button using JS and styling with CSS and Image 2023-05-31 17:38:44 -03:00
Petrik 4bd199301e Use h1 for guide titles
Currently the guides use the h1 tag for the guides logo instead of the
guides title. As the guides title is more important in describing the
content of a guide, the title should use the h1 instead.
This also move every other heading to a more important heading (h3 becomes h2, etc.).

This change should improve SEO for the guides.
2023-04-18 22:27:03 +02:00
Alex Ghiculescu 0d7a6f50e7 Update Rails welcome image in guides
ref: https://github.com/rails/rails/pull/47550#issuecomment-1452756945
2023-03-02 18:07:45 -07:00
zzak a123915f64
Update kindle cover 2023-02-14 13:00:19 +09:00
Hartley McGuire a42863f514
Add rake task to vendor guide javascript
The Rails guides were migrated from Turbolinks to Turbo in
0f6575a534

The PR discussion explains that the file was grabbed from unpkg, and a
decision was made to not run it through a minifier.

This commit adds a rake task to automate the process of grabbing the
turbo js file using Importmap::Packager, which is what importmap-rails
uses for `bin/importmap pin --download`.

The extra Importmap module definition is necessary because the
Importmap::Packager file uses the shorthand module syntax, meaning that
an error is thrown if the Importmap module is not previously defined.
`require "importmap-rails"` would normally define this module, but one
of its dependent requires will not load outside of a Rails application.

The turbo.css file was removed as it appears to be leftover from
Turbolinks and Turbo does not provide any css files in its dist.
2023-02-13 00:58:58 -05:00
Yasuo Honda f838a74212
Merge pull request #46866 from ghousemohamed/change-year-2022-to-2023 2023-02-13 13:15:43 +09:00
zzak 9dfb3b6f98 ImageOptim guides images 2023-02-07 17:06:58 +09:00
zzak 641814b47d Use a screenshot to show the class_eval code comment example 2023-02-07 11:24:04 +09:00
Ghouse Mohamed e0559d2c1c Change 2022 -> 2023 2023-01-03 13:22:00 +05:30
Rafael Mendonça França b85296efe6
Merge pull request #45932 from marcoroth/migrate-guides-to-turbo
Migrate Rails Guides from `Turbolinks` to `Turbo`
2022-11-14 18:33:44 -05:00
sampatbadhe cffce5d646 Rails Guides - set "cursor: pointer" and on hover "color: #005cc5" css to copy code button [ci-skip] 2022-11-09 07:55:49 +05:30
Marco Roth 0f6575a534 Migrate Rails Guides from `Turbolinks` to `Turbo` 2022-10-17 22:07:33 +02:00
Geon George 56e96d9344 Replaces mobi guide with epub for docs because of discontinued support
Removes kindlerb logic

Adds template for epub generator

Renames the kindle dir to /epub

Adds epub module to generator and replaces kindle

Fixes mimetype

Creates basic epub book

Deletes old kindle module

Adds zip package

Updates rubyzip gem name

Removes now unused gepub gem

Adds the required container file for epubs

Fixes media type

Adds new epub generation logic

Removes all buttons from output html

Refactors and generates valid epub files

Removes frontmatter logic used for kindlegen

Filters out epub files in zip

Updates link to kindle doc on sidebar

Fixes rubocop issues

Adds deprecation warning for the old kindle task

Refactors and cleans up epub module

Cleans up epub code

Cleans up private internal method code style

Removes unnecessary imagemagick check
2022-08-05 00:18:20 +05:30
Jonathan Hefner 23d0cd6f6f Unify LTR / RTL CSS for guides
When `main.css` is updated, it is easy for `main.rtl.css` to be
overlooked (see #45423).

This commit eliminates `main.rtl.css` in favor of a unified approach to
LTR / RTL styling in `main.css`.  To accomplish this, the `<body>`
element is rendered with a [`dir` attribute][] (which has the same
effect as setting the CSS `direction` property), and LTR- / RTL-specific
styles are prefixed with `:where(body[dir="..."])` selectors.  (The
[`:where()` pseudo-class][] ensures that selector specificity is not
changed.)

This change also paves the way for automatic detection and application
of LTR / RTL styles when the [`:dir()` pseudo-class][] gains widespread
browser support.

[`dir` attribute]: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/dir
[`:where()` pseudo-class]: https://developer.mozilla.org/en-US/docs/Web/CSS/:where
[`:dir()` pseudo-class]: https://developer.mozilla.org/en-US/docs/Web/CSS/:dir
2022-06-22 16:42:48 -05:00
Hartley McGuire 02449bf8bf
Fix guides rtl css out of sync with ltr
A few changes were made to main.css that didn't make it to
main.rtl.css:

- f6bcd14
- 9695943
- 674d952
- 5443c96
2022-06-21 17:56:53 -04:00
Petrik d844f24f73 Show Guides Index as selected for `/` on small screens [ci-skip]
On small screens the guides index is shown as a select dropdown.
The Guides Index option has the value 'index.html'.
When visiting `https://guides.rubyonrails.org/` this option won't be
selected as the pathname doesn't include index.html.

Javascript treats empty strings as falsey, so for the root path we can
return `index.html` instead of a empty string.
2022-06-06 19:05:51 +02:00
Petrik 55073ac10f Use the CSS badge for the API docs as well
Sdoc 2.4.0 supports a CSS badge that can be set by passing the version
as the HORO_BADGE_VERSION env variable.

The old badge image can be removed, as it no longer needs to be copied
by the docs server: https://github.com/rails/rails-docs-server/pull/28
2022-05-10 21:05:59 +02:00
Yasuo Honda 4f08d9d753 Update Rails startup screenshot at Rails Guide
This commit updates Rails startup screenshot at Rails Guide
to support 5889e6ba92

Here are some notes:

- It used to be called "Yay! You're on Rails!" page. Now the new page
  does not have any text messages. Then I just call it "The Rails startup
  page".

- This Rails statup page screenshot is taken at my Macbook and saved as
  PNG. No compressions have been made.

- Specific Rails version and Ruby versions are included.

Fix#43892
2021-12-16 15:05:32 +09:00
Rafael França b3efb35aa3
Merge pull request #42989 from jharrilim/patch-2
Change diff highlighting background for dark mode
2021-09-20 16:28:14 -04:00
Rafael França 7f593b6052
Merge pull request #43113 from intrip/hide-guides-with-escape
Close guides dropdown with Escape keypress
2021-09-20 16:17:29 -04:00
ChloeLiang 881bcc3cf7 Fix docs spacing 2021-09-19 09:22:02 +08:00
Jacopo 4370414969 Close guides dropdown with Escape keypress
When Escape is pressed the guides dropdown is automatically closed.

This change mimics the behaviour of HTML selects.
2021-08-26 14:44:58 +02:00
Joe a3b26873eb
Change diff highlighting background for dark mode 2021-08-10 13:54:21 -04:00
Jonathan Hefner b78966b558 Render copy-to-clipboard text in element attribute [ci-skip]
Rendering copy-to-clipboard text in an invisible element causes
invisible extraneous matches when searching text on the page (e.g. with
Ctrl+F).  Rendering in an element attribute avoids this problem.
2021-07-23 12:52:10 -05:00
Eileen M. Uchitelle 52e3dc23b9
Merge pull request #42799 from lloydk/header-footer-contrast
Fix text contrast for guide header and footer [ci-skip]
2021-07-16 13:11:12 -04:00
Lloyd Kupchanko 11fc2e1566 Fix contrast ratio for guide syntax hilighting [ci-skip]
The theme used for syntax hilighting has a number of colors that
do not meet the 4.5:1 minimum contrast ratio of the Web Content
Accessibility Guidelines (WCAG) 2.1 standard.

All colors that were below 4.5:1 on a background of #eeeeee have
been adjusted to be at or slightly above 4.5:1 using tweaked
versions of the tools in this repository:

https://github.com/mpchadwick/pygments-high-contrast-stylesheets/
2021-07-16 02:41:10 -06:00
Lloyd Kupchanko 674d9523c6 Fix text contrast for guide header and footer [ci-skip]
Links in the header and footer of the guides currently have a
contrast ratio of 4.1:1 which is below the 4.5:1 ratio required
to pass the minimum Web Content Accessibility Guidelines (WCAG) 2.1
standard.

WCAG 2.1 Understanding Success Criterion 1.4.3: Contrast (Minimum)
https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html

Red text on a dark grey background (#22222) is generally considered
hard to read so the links were changed to the pink color from the
Rails Guides logo. Using pink avoids adding yet another shade of red
to the guideline color palette and as an added bonus has a contrast
ratio of 7.04:1 which meets the 7:1 ratio of the enhanced contrast
success criterion.

Understanding Success Criterion 1.4.6: Contrast (Enhanced)
https://www.w3.org/WAI/WCAG21/Understanding/contrast-enhanced
2021-07-16 01:13:40 -06:00
Lloyd Kupchanko 4eb96207b0 Show keyboard focus indicator in guides [ci-skip]
Restore the default browser focus indicator to improve the
accessibility of the guides for users who rely on a keyboard
for navigation.

For more information see:

Understanding Success Criterion 2.4.7: Focus Visible

in the Web Content Accessibility Guidelines (WCAG) 2.1
https://www.w3.org/WAI/WCAG21/Understanding/focus-visible.html
2021-07-14 01:05:36 -06:00
Henrique Morato 1c4c5736d9 [ci skip] Kindle info icon fix 2021-06-07 16:10:24 -03:00
Mark Godwin 400bf4ec04 [ci skip] Adds Dark Mode Iconography
Adds dark mode icons to the dark mode color scheme for rails guides.
2021-04-19 09:20:20 -06:00
Mark Godwin bfa5b45f42 [ci skip] Adds Dark Mode to Rails Guides
Adds dark mode classes using the @media query `prefers-color-scheme`.  Also adds a dark color scheme for code highlighting to make code snippets more readable.

[ci skip] Adds Dark Mode to Rails Guides

Adds dark mode classes using the @media query `prefers-color-scheme`.  Also adds a dark color scheme for code highlighting to make code snippets more readable.
2021-04-15 09:17:30 -06:00
Mike Rogers 5530904295 Just adding an allow all robots.txt file 2021-02-23 18:14:05 +00:00
Mike Rogers 6efdd6f814 Adding a robots.txt to the guide 2021-02-19 20:57:23 +00:00
Petrik a24fc7ac1d Always show version badge, not just for edge [ci skip]
Now that we have a CSS based version banner since 1c5d9a89a7
we can also show the banner for non edge versions.
2020-11-09 20:28:08 +01:00
Jonathan Hefner 9f7d2656fa
Merge pull request #40481 from jonathanhefner/guide-getting_started-rework
Rework Getting Started guide [ci-skip]
2020-11-02 11:55:48 -06:00
Jonathan Hefner 8fa3b80ba2 Edit GS guide § Deleting an Article [ci-skip]
Fixes #39920.
Resolves #38329.

Co-Authored-By: Ryan Bigg <me@ryanbigg.com>
Co-Authored-By: Petrik de Heus <petrik@deheus.net>
2020-11-01 11:49:29 -06:00
Jonathan Hefner 0bf055e5f1 Edit GS guide § Updating an Article [ci-skip]
Fixes #39920.
Resolves #38329.

Co-Authored-By: Ryan Bigg <me@ryanbigg.com>
Co-Authored-By: Petrik de Heus <petrik@deheus.net>
2020-11-01 11:49:29 -06:00
Jonathan Hefner fdca84c63f Edit GS guide § Validations and Error Messages [ci-skip]
Fixes #39920.
Resolves #38328.

Co-Authored-By: Ryan Bigg <me@ryanbigg.com>
Co-Authored-By: Tasos Latsas <tlatsas2000@gmail.com>
2020-11-01 11:49:29 -06:00
Jonathan Hefner 0d04178c81 Edit GS guide § Using Strong Parameters [ci-skip]
Fixes #39920.
Resolves #38328.

Co-Authored-By: Ryan Bigg <me@ryanbigg.com>
2020-10-31 17:11:31 -05:00
Jonathan Hefner 0079c3ff55 Edit GS guide § Using a Form Builder [ci-skip]
Fixes #39920.
Resolves #38328.

Co-Authored-By: Ryan Bigg <me@ryanbigg.com>
2020-10-31 17:04:48 -05:00
Jonathan Hefner bdb2b7967f Edit GS guide § Creating a New Article [ci-skip]
Fixes #39920.
Resolves #38328.

Co-Authored-By: Ryan Bigg <me@ryanbigg.com>
2020-10-31 17:04:48 -05:00
Jonathan Hefner fa64129117 Edit GS guide § Resourceful Routing [ci-skip]
Fixes #39920.
Resolves #38288.

Co-Authored-By: Ryan Bigg <me@ryanbigg.com>
Co-Authored-By: Eileen M. Uchitelle <eileencodes@gmail.com>
Co-Authored-By: Petrik de Heus <petrik@deheus.net>
2020-10-31 17:04:48 -05:00
Jonathan Hefner 69979b9ad1 Edit GS guide § Showing a Single Article [ci-skip]
Fixes #39920.
Resolves #38288.

Co-Authored-By: Ryan Bigg <me@ryanbigg.com>
Co-Authored-By: Eileen M. Uchitelle <eileencodes@gmail.com>
Co-Authored-By: Petrik de Heus <petrik@deheus.net>
Co-Authored-By: Tasos Latsas <tlatsas2000@gmail.com>
2020-10-31 17:04:48 -05:00
Jonathan Hefner c73eb83c3e Fix triple-click-to-select for IRB code examples [ci-skip]
Previously, both the IRB prompt and the line of code were selected on
triple-click.  This commit causes only the line of code to be selected.
2020-10-31 16:47:52 -05:00
Jonathan Hefner fd3fd618f4 Add gitattributes for vendored and generated files [ci-skip]
The `linguist-vendored` attribute excludes the specified file from the
project's language stats on GitHub.  The `linguist-generated` attribute
does the same, and also suppresses that file in diffs on GitHub.

See https://github.com/github/linguist for more information.
2020-10-04 16:44:37 -05:00
Petrik 4c258caba2 Add copy button for copying guide code examples [skip ci]
Instead of carefully selecting the code in examples, use a copy button
for copying the code. This uses https://clipboardjs.com/ for copying.

For the bash code examples only line starting with $ prompt are copied.
The $ prompt itself is not copied.
2020-10-01 16:32:43 +02:00
Rafael França e6c61c54bb
Merge pull request #39406 from vipulnsward/ar-bookstore-model
Changes over AR Querying guide making use of Bookstore example
2020-08-25 17:58:32 -04:00
Eugene Kenny d927d3be05
Merge pull request #39777 from p8/guides/rouge-highlighting
Replace javascript highlighting in guides with Rouge [ci skip]
2020-07-08 13:59:30 +01:00