Commit Graph

19 Commits

Author SHA1 Message Date
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