Commit Graph

27 Commits

Author SHA1 Message Date
John Athayde
7dbe81710e
Improve RTL Rendering for Guides (#51613)
Improve RTL language support, specifically focused on Arabic (MSA), Farsi, and Hebrew languages, including custom fonts for those languages, a javascript to detect auto-translation and shift the dir attribute, and other cleanup based on volunteer feedback.

Co-authored-by: Carlos Antonio da Silva <carlosantoniodasilva@gmail.com>
2024-06-07 14:00:52 -03:00
MooseCowBear
1e13e912bf add navbar highlighting to guides 2024-04-25 12:14:14 -04:00
John Athayde
1e4f12c12c
Guides visual redesign (#51341)
Improve the visual presentation of the Rails Guides, bringing them more inline with the new marketing rubyonrails.org site, as part of a project with the Rails Foundation.

The CSS has been recreated from SCSS files, generated into the final pieces. The stylesrc directory contains those commented source files. The generate task will now process those scss => css files.

Co-authored-by: Carlos Antonio da Silva <carlosantoniodasilva@gmail.com>
2024-03-20 16:50:51 -03:00
Alysson Rosa
22397bec6f Adding the button using JS and styling with CSS and Image 2023-05-31 17:38:44 -03:00
Hartley McGuire
a42863f514
Add rake task to vendor guide javascript
The Rails guides were migrated from Turbolinks to Turbo in
0f6575a5344246d385d1a724e8b0bb3544ab6478

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
Ghouse Mohamed
e0559d2c1c Change 2022 -> 2023 2023-01-03 13:22:00 +05:30
Marco Roth
0f6575a534 Migrate Rails Guides from Turbolinks to Turbo 2022-10-17 22:07:33 +02: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
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
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
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
Petrik
f6bcd1496e Use Rouge for guides code highlighting [ci skip]
Replace javascript highlighting using Prism with the Rouge markdown
highlighter. Uses the github theme.
2020-07-08 09:05:08 +02:00
R. Miles McCain
7f77b1d5b6
Remove broken responsive-tables JS
Add better responsive CSS for tables in guides

Fix borders & breakpoints for responsive tables

Add table fixes to RTL stylesheets

Use 480px breakpoints, remove outdated CSS
2020-07-04 06:18:58 +00:00
Petrik
4c9b22dae9 Highlight code with Prism on 'turbolinks:load' [ci skip] 2019-12-17 19:38:07 -05:00
Akshay Birajdar
652e0aa300 Removes the un-used function call for syntaxhighlighterConfig [ci skip] 2019-12-17 20:05:36 +05:30
Petrik
ceb54819bd Use prism.js for code highlighting in guides [ci skip]
Replace SyntaxHighlighter with prism.js. SyntaxHighlighter does not seem
to be maintained. Prism.js seems a nice alternative with support for
Ruby, javascript, erb and yaml. Prism.js uses the MIT License.
https://github.com/PrismJS/prism

For bash a customized definition of the bash+shell-session themes is
used with the following comamnds  added commands:
brew, bundle, cat, git, gem, rackup, rake, rails, ruby, rubocop and
  yarn
2019-12-16 19:52:13 +01:00
Yoshiyuki Hirano
e5d38a24dc Use Turbolinks in Rails guides 2018-04-23 20:07:05 +09:00
Yoshiyuki Hirano
b261508002 Refactor guides javascripts
* Remove `$` prefix from all variables (`$` prefix means jQuery object)
* Old browsers doesn't support forEach. So use for instead of forEach.
2018-04-23 04:30:47 +09:00
Yoshiyuki Hirano
419adbf1a5 ✂️ jQuery for Rails Guides
* Rewrite with Vanilla JS
* Confirmed with Chrome, Safari, Firefox
2018-04-21 20:59:45 +09:00
Vipul A M
9a53b0f44a
- Update Syntax Highlighter to version 4.
- Build Syntax Highlighter based on https://github.com/syntaxhighlighter/syntaxhighlighter/wiki/Building and use theme generated by fxn.
- This also bundles these brushes in the file itself- ruby,css,xml,sql,javascript,plain. Generation command used:
gulp build --compat --brushes=javascript,ruby,xml,sql,plain --theme=/Path/To/RailsSource/rails/guides/assets/stylesheets/syntaxhighlighter/shThemeRailsGuides.css
- rm all old js and css files
- Moved over how JS configuration is created for Syntax Highlighter
- Fixed layout for all imports
- Fixes bug with old copy paste, generating wrong space character on webkit 7caa9632e7/src/dom.js (L227)

 Fixes #25655
2016-07-03 00:20:27 -07:00
Satoshi Ohmori
109b30ff8b Change permission to readonly
changed from 755 to 644.
I executed `chmod -x guides/assets/javascripts/responsive-tables.js`.
[ci skip]
2016-01-23 21:48:15 +09:00
Juanito Fatas
0d9e58f879 Disable autolink in example code blocks in guides.
/cc @chancancode @robin850

configuration reference: http://alexgorbatchev.com/SyntaxHighlighter/manual/configuration/

Related issues:

* https://github.com/vmg/redcarpet/issues/334

* https://github.com/docrails-tw/guides/issues/62
2014-06-24 06:33:07 +08:00
Ryunosuke SATO
501e663a25 Improve js written for guides
* Stop using unnecessary global variable
* Use function defined by jQuery for simplicity
* Fix event listner for "more info button" to handle
  event on resize browser
2013-06-25 01:43:11 +09:00
Joe Fiorini
65a2977cdd [Guides] Format content for small devices 2012-10-06 16:40:51 -04:00
Joe Fiorini
03bcd416b0 [Guides] Navigation styling for small devices 2012-10-06 16:38:37 -04:00
Xavier Noria
6d87cd028b moves the guides up to the root directory 2012-03-17 08:32:49 -07:00