Add standard and run it on config

Baby steps.
This commit is contained in:
Olivier Lacan 2024-02-04 17:01:47 -08:00
parent 51475fa00b
commit 84d7c7834a
3 changed files with 89 additions and 49 deletions

View File

@ -9,3 +9,4 @@ gem "middleman-minify-html"
gem "middleman-syntax"
gem "middleman-gh-pages"
gem "redcarpet"
gem "standard", "~> 1.33"

View File

@ -1,13 +1,14 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (7.0.5)
activesupport (7.0.8)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
addressable (2.8.4)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
ast (2.4.2)
autoprefixer-rails (10.4.7.0)
execjs (~> 2)
backports (3.24.1)
@ -15,7 +16,7 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.12.2)
concurrent-ruby (1.2.2)
concurrent-ruby (1.2.3)
contracts (0.17)
dotenv (2.8.1)
em-websocket (0.5.3)
@ -23,10 +24,10 @@ GEM
http_parser.rb (~> 0)
erubis (2.7.0)
eventmachine (1.2.7)
execjs (2.8.1)
execjs (2.9.1)
fast_blank (1.0.1)
fastimage (2.2.7)
ffi (1.15.5)
fastimage (2.3.0)
ffi (1.16.3)
haml (6.1.1)
temple (>= 0.8.2)
thor
@ -38,8 +39,11 @@ GEM
http_parser.rb (0.8.0)
i18n (1.6.0)
concurrent-ruby (~> 1.0)
json (2.7.1)
kramdown (2.4.0)
rexml
language_server-protocol (3.17.0.3)
lint_roller (1.1.0)
listen (3.8.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
@ -93,31 +97,66 @@ GEM
middleman-minify-html (3.4.1)
htmlcompressor (~> 0.2.0)
middleman-core (>= 3.2)
middleman-syntax (3.3.0)
middleman-syntax (3.4.0)
middleman-core (>= 3.2)
rouge (~> 3.2)
minitest (5.18.0)
minitest (5.21.2)
padrino-helpers (0.15.3)
i18n (>= 0.6.7, < 2)
padrino-support (= 0.15.3)
tilt (>= 1.4.1, < 3)
padrino-support (0.15.3)
parallel (1.23.0)
parallel (1.24.0)
parser (3.3.0.5)
ast (~> 2.4.1)
racc
parslet (2.0.0)
public_suffix (5.0.1)
rack (2.2.7)
public_suffix (5.0.4)
racc (1.7.3)
rack (2.2.8)
rack-livereload (0.3.17)
rack
rainbow (3.1.1)
rake (13.0.6)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
redcarpet (3.6.0)
regexp_parser (2.9.0)
rexml (3.2.5)
rouge (3.30.0)
rubocop (1.59.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.2.2.4)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.30.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
rubocop-performance (1.20.2)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
ruby-progressbar (1.13.0)
sassc (2.4.0)
ffi (~> 1.9)
servolux (0.13.0)
standard (1.33.0)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.59.0)
standard-custom (~> 1.0.0)
standard-performance (~> 1.3)
standard-custom (1.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.50)
standard-performance (1.3.1)
lint_roller (~> 1.1)
rubocop-performance (~> 1.20.2)
temple (0.10.2)
thor (1.2.2)
tilt (2.0.11)
@ -127,6 +166,7 @@ GEM
concurrent-ruby (~> 1.0)
uglifier (3.2.0)
execjs (>= 0.3.0, < 3)
unicode-display_width (2.5.0)
webrick (1.8.1)
PLATFORMS
@ -142,6 +182,7 @@ DEPENDENCIES
middleman-minify-html
middleman-syntax
redcarpet
standard (~> 1.33)
BUNDLED WITH
2.1.4

View File

@ -13,7 +13,7 @@ $last_version = "1.1.0"
$previous_version = $versions[$versions.index($last_version) - 1]
# This list of languages populates the language navigation.
issues_url = 'https://github.com/olivierlacan/keep-a-changelog/issues'
issues_url = "https://github.com/olivierlacan/keep-a-changelog/issues"
$languages = {
"ar" => {
name: "العربية"
@ -85,7 +85,7 @@ $languages = {
<a href='#{issues_url}'>ajudar em sua tradução</a>."
},
"ro" => {
name: 'română',
name: "română",
new: "O nouă versiune este disponibilă"
},
"ru" => {
@ -139,9 +139,9 @@ activate :i18n,
lang_map: $languages,
mount_at_root: :en
set :gauges_id, ''
set :publisher_url, 'https://www.facebook.com/olivier.lacan.5'
set :site_url, 'https://keepachangelog.com'
set :gauges_id, ""
set :publisher_url, "https://www.facebook.com/olivier.lacan.5"
set :site_url, "https://keepachangelog.com"
redirect "index.html", to: "en/#{$last_version}/index.html"
@ -153,10 +153,10 @@ end
# ----- Assets ----- #
set :css_dir, 'assets/stylesheets'
set :js_dir, 'assets/javascripts'
set :images_dir, 'assets/images'
set :fonts_dir, 'assets/fonts'
set :css_dir, "assets/stylesheets"
set :js_dir, "assets/javascripts"
set :images_dir, "assets/images"
set :fonts_dir, "assets/fonts"
# ----- Images ----- #
@ -170,7 +170,7 @@ set :markdown_engine, :redcarpet
## Override default Redcarpet renderer in order to define a class
class CustomMarkdownRenderer < Redcarpet::Render::HTML
def doc_header
%Q[<nav class="toc">#{@header}</nav>]
%(<nav class="toc">#{@header}</nav>)
end
def header(text, header_level)
@ -216,8 +216,6 @@ helpers do
"#{$last_version} #{language_name}"
elsif File.exist?("#{language_path}/#{$previous_version}")
"#{$previous_version} #{language_name}"
else
nil
end
end
end
@ -263,7 +261,7 @@ end
# ----- Prefixing ----- #
activate :autoprefixer do |config|
config.browsers = ['last 2 versions', 'Explorer >= 10']
config.browsers = ["last 2 versions", "Explorer >= 10"]
config.cascade = false
end
@ -271,18 +269,18 @@ end
# default Markdown Haml filter and reconfigure one that follows our
# global configuration.
module Haml::Filters
remove_filter("Markdown") #remove the existing Markdown filter
# module Haml::Filters
# remove_filter("Markdown") #remove the existing Markdown filter
module Markdown
include Haml::Filters::Base
# module Markdown
# include Haml::Filters::Base
def renderer
$markdown_config[:renderer]
end
# def renderer
# $markdown_config[:renderer]
# end
def render(text)
Redcarpet::Markdown.new(renderer.new($markdown_config)).render(text)
end
end
end
# def render(text)
# Redcarpet::Markdown.new(renderer.new($markdown_config)).render(text)
# end
# end
# end