diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 000000000..944880fa1 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +3.2.0 diff --git a/Gemfile b/Gemfile index 7d7467ebe..f24d05f4a 100644 --- a/Gemfile +++ b/Gemfile @@ -2,3 +2,7 @@ source 'https://rubygems.org' gem 'github-pages' gem 'json', '>= 2.0.0' +gem 'webrick', '>= 1.8' +gem 'csv', '~> 3.3' +gem 'base64', '~> 0.2.0' +gem 'bigdecimal', '~> 3.1' diff --git a/Gemfile.lock b/Gemfile.lock index ee11838c9..f77a0774e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,252 +1,270 @@ GEM remote: https://rubygems.org/ specs: - activesupport (4.2.11.1) - i18n (~> 0.7) - minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) - tzinfo (~> 1.1) - addressable (2.8.0) - public_suffix (>= 2.0.2, < 5.0) + activesupport (7.0.7.2) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + addressable (2.8.1) + public_suffix (>= 2.0.2, < 6.0) + base64 (0.2.0) + bigdecimal (3.1.9) coffee-script (2.4.1) coffee-script-source execjs coffee-script-source (1.11.1) colorator (1.1.0) - commonmarker (0.17.13) - ruby-enum (~> 0.5) - concurrent-ruby (1.1.5) - dnsruby (1.61.2) - addressable (~> 2.5) - em-websocket (0.5.1) + commonmarker (0.23.10) + concurrent-ruby (1.2.2) + csv (3.3.3) + dnsruby (1.61.9) + simpleidn (~> 0.1) + em-websocket (0.5.3) eventmachine (>= 0.12.9) - http_parser.rb (~> 0.6.0) - ethon (0.12.0) - ffi (>= 1.3.0) + http_parser.rb (~> 0) + ethon (0.16.0) + ffi (>= 1.15.0) eventmachine (1.2.7) - execjs (2.7.0) - faraday (0.15.4) - multipart-post (>= 1.2, < 3) - ffi (1.11.1) + execjs (2.8.1) + faraday (2.7.4) + faraday-net_http (>= 2.0, < 3.1) + ruby2_keywords (>= 0.0.4) + faraday-net_http (3.0.2) + ffi (1.15.5) forwardable-extended (2.6.0) gemoji (3.0.1) - github-pages (198) - activesupport (= 4.2.11.1) - github-pages-health-check (= 1.16.1) - jekyll (= 3.8.5) - jekyll-avatar (= 0.6.0) + github-pages (228) + github-pages-health-check (= 1.17.9) + jekyll (= 3.9.3) + jekyll-avatar (= 0.7.0) jekyll-coffeescript (= 1.1.1) - jekyll-commonmark-ghpages (= 0.1.5) + jekyll-commonmark-ghpages (= 0.4.0) jekyll-default-layout (= 0.1.4) - jekyll-feed (= 0.11.0) + jekyll-feed (= 0.15.1) jekyll-gist (= 1.5.0) - jekyll-github-metadata (= 2.12.1) - jekyll-mentions (= 1.4.1) - jekyll-optional-front-matter (= 0.3.0) + jekyll-github-metadata (= 2.13.0) + jekyll-include-cache (= 0.2.1) + jekyll-mentions (= 1.6.0) + jekyll-optional-front-matter (= 0.3.2) jekyll-paginate (= 1.1.0) - jekyll-readme-index (= 0.2.0) - jekyll-redirect-from (= 0.14.0) - jekyll-relative-links (= 0.6.0) - jekyll-remote-theme (= 0.3.1) + jekyll-readme-index (= 0.3.0) + jekyll-redirect-from (= 0.16.0) + jekyll-relative-links (= 0.6.1) + jekyll-remote-theme (= 0.4.3) jekyll-sass-converter (= 1.5.2) - jekyll-seo-tag (= 2.5.0) - jekyll-sitemap (= 1.2.0) - jekyll-swiss (= 0.4.0) - jekyll-theme-architect (= 0.1.1) - jekyll-theme-cayman (= 0.1.1) - jekyll-theme-dinky (= 0.1.1) - jekyll-theme-hacker (= 0.1.1) - jekyll-theme-leap-day (= 0.1.1) - jekyll-theme-merlot (= 0.1.1) - jekyll-theme-midnight (= 0.1.1) - jekyll-theme-minimal (= 0.1.1) - jekyll-theme-modernist (= 0.1.1) - jekyll-theme-primer (= 0.5.3) - jekyll-theme-slate (= 0.1.1) - jekyll-theme-tactile (= 0.1.1) - jekyll-theme-time-machine (= 0.1.1) - jekyll-titles-from-headings (= 0.5.1) - jemoji (= 0.10.2) - kramdown (= 1.17.0) - liquid (= 4.0.0) - listen (= 3.1.5) + jekyll-seo-tag (= 2.8.0) + jekyll-sitemap (= 1.4.0) + jekyll-swiss (= 1.0.0) + jekyll-theme-architect (= 0.2.0) + jekyll-theme-cayman (= 0.2.0) + jekyll-theme-dinky (= 0.2.0) + jekyll-theme-hacker (= 0.2.0) + jekyll-theme-leap-day (= 0.2.0) + jekyll-theme-merlot (= 0.2.0) + jekyll-theme-midnight (= 0.2.0) + jekyll-theme-minimal (= 0.2.0) + jekyll-theme-modernist (= 0.2.0) + jekyll-theme-primer (= 0.6.0) + jekyll-theme-slate (= 0.2.0) + jekyll-theme-tactile (= 0.2.0) + jekyll-theme-time-machine (= 0.2.0) + jekyll-titles-from-headings (= 0.5.3) + jemoji (= 0.12.0) + kramdown (= 2.3.2) + kramdown-parser-gfm (= 1.1.0) + liquid (= 4.0.4) mercenary (~> 0.3) - minima (= 2.5.0) - nokogiri (>= 1.8.5, < 2.0) - rouge (= 2.2.1) + minima (= 2.5.1) + nokogiri (>= 1.13.6, < 2.0) + rouge (= 3.26.0) terminal-table (~> 1.4) - github-pages-health-check (1.16.1) + github-pages-health-check (1.17.9) addressable (~> 2.3) dnsruby (~> 1.60) octokit (~> 4.0) - public_suffix (~> 3.0) + public_suffix (>= 3.0, < 5.0) typhoeus (~> 1.3) - html-pipeline (2.11.0) + html-pipeline (2.14.3) activesupport (>= 2) nokogiri (>= 1.4) - http_parser.rb (0.6.0) - i18n (0.9.5) + http_parser.rb (0.8.0) + i18n (1.14.1) concurrent-ruby (~> 1.0) - jekyll (3.8.5) + jekyll (3.9.3) addressable (~> 2.4) colorator (~> 1.0) em-websocket (~> 0.5) - i18n (~> 0.7) + i18n (>= 0.7, < 2) jekyll-sass-converter (~> 1.0) jekyll-watch (~> 2.0) - kramdown (~> 1.14) + kramdown (>= 1.17, < 3) liquid (~> 4.0) mercenary (~> 0.3.3) pathutil (~> 0.9) rouge (>= 1.7, < 4) safe_yaml (~> 1.0) - jekyll-avatar (0.6.0) - jekyll (~> 3.0) + jekyll-avatar (0.7.0) + jekyll (>= 3.0, < 5.0) jekyll-coffeescript (1.1.1) coffee-script (~> 2.2) coffee-script-source (~> 1.11.1) - jekyll-commonmark (1.3.1) - commonmarker (~> 0.14) - jekyll (>= 3.7, < 5.0) - jekyll-commonmark-ghpages (0.1.5) - commonmarker (~> 0.17.6) - jekyll-commonmark (~> 1) - rouge (~> 2) + jekyll-commonmark (1.4.0) + commonmarker (~> 0.22) + jekyll-commonmark-ghpages (0.4.0) + commonmarker (~> 0.23.7) + jekyll (~> 3.9.0) + jekyll-commonmark (~> 1.4.0) + rouge (>= 2.0, < 5.0) jekyll-default-layout (0.1.4) jekyll (~> 3.0) - jekyll-feed (0.11.0) - jekyll (~> 3.3) + jekyll-feed (0.15.1) + jekyll (>= 3.7, < 5.0) jekyll-gist (1.5.0) octokit (~> 4.2) - jekyll-github-metadata (2.12.1) - jekyll (~> 3.4) + jekyll-github-metadata (2.13.0) + jekyll (>= 3.4, < 5.0) octokit (~> 4.0, != 4.4.0) - jekyll-mentions (1.4.1) + jekyll-include-cache (0.2.1) + jekyll (>= 3.7, < 5.0) + jekyll-mentions (1.6.0) html-pipeline (~> 2.3) - jekyll (~> 3.0) - jekyll-optional-front-matter (0.3.0) - jekyll (~> 3.0) + jekyll (>= 3.7, < 5.0) + jekyll-optional-front-matter (0.3.2) + jekyll (>= 3.0, < 5.0) jekyll-paginate (1.1.0) - jekyll-readme-index (0.2.0) - jekyll (~> 3.0) - jekyll-redirect-from (0.14.0) - jekyll (~> 3.3) - jekyll-relative-links (0.6.0) - jekyll (~> 3.3) - jekyll-remote-theme (0.3.1) - jekyll (~> 3.5) - rubyzip (>= 1.2.1, < 3.0) + jekyll-readme-index (0.3.0) + jekyll (>= 3.0, < 5.0) + jekyll-redirect-from (0.16.0) + jekyll (>= 3.3, < 5.0) + jekyll-relative-links (0.6.1) + jekyll (>= 3.3, < 5.0) + jekyll-remote-theme (0.4.3) + addressable (~> 2.0) + jekyll (>= 3.5, < 5.0) + jekyll-sass-converter (>= 1.0, <= 3.0.0, != 2.0.0) + rubyzip (>= 1.3.0, < 3.0) jekyll-sass-converter (1.5.2) sass (~> 3.4) - jekyll-seo-tag (2.5.0) - jekyll (~> 3.3) - jekyll-sitemap (1.2.0) - jekyll (~> 3.3) - jekyll-swiss (0.4.0) - jekyll-theme-architect (0.1.1) - jekyll (~> 3.5) + jekyll-seo-tag (2.8.0) + jekyll (>= 3.8, < 5.0) + jekyll-sitemap (1.4.0) + jekyll (>= 3.7, < 5.0) + jekyll-swiss (1.0.0) + jekyll-theme-architect (0.2.0) + jekyll (> 3.5, < 5.0) jekyll-seo-tag (~> 2.0) - jekyll-theme-cayman (0.1.1) - jekyll (~> 3.5) + jekyll-theme-cayman (0.2.0) + jekyll (> 3.5, < 5.0) jekyll-seo-tag (~> 2.0) - jekyll-theme-dinky (0.1.1) - jekyll (~> 3.5) + jekyll-theme-dinky (0.2.0) + jekyll (> 3.5, < 5.0) jekyll-seo-tag (~> 2.0) - jekyll-theme-hacker (0.1.1) - jekyll (~> 3.5) + jekyll-theme-hacker (0.2.0) + jekyll (> 3.5, < 5.0) jekyll-seo-tag (~> 2.0) - jekyll-theme-leap-day (0.1.1) - jekyll (~> 3.5) + jekyll-theme-leap-day (0.2.0) + jekyll (> 3.5, < 5.0) jekyll-seo-tag (~> 2.0) - jekyll-theme-merlot (0.1.1) - jekyll (~> 3.5) + jekyll-theme-merlot (0.2.0) + jekyll (> 3.5, < 5.0) jekyll-seo-tag (~> 2.0) - jekyll-theme-midnight (0.1.1) - jekyll (~> 3.5) + jekyll-theme-midnight (0.2.0) + jekyll (> 3.5, < 5.0) jekyll-seo-tag (~> 2.0) - jekyll-theme-minimal (0.1.1) - jekyll (~> 3.5) + jekyll-theme-minimal (0.2.0) + jekyll (> 3.5, < 5.0) jekyll-seo-tag (~> 2.0) - jekyll-theme-modernist (0.1.1) - jekyll (~> 3.5) + jekyll-theme-modernist (0.2.0) + jekyll (> 3.5, < 5.0) jekyll-seo-tag (~> 2.0) - jekyll-theme-primer (0.5.3) - jekyll (~> 3.5) + jekyll-theme-primer (0.6.0) + jekyll (> 3.5, < 5.0) jekyll-github-metadata (~> 2.9) jekyll-seo-tag (~> 2.0) - jekyll-theme-slate (0.1.1) - jekyll (~> 3.5) + jekyll-theme-slate (0.2.0) + jekyll (> 3.5, < 5.0) jekyll-seo-tag (~> 2.0) - jekyll-theme-tactile (0.1.1) - jekyll (~> 3.5) + jekyll-theme-tactile (0.2.0) + jekyll (> 3.5, < 5.0) jekyll-seo-tag (~> 2.0) - jekyll-theme-time-machine (0.1.1) - jekyll (~> 3.5) + jekyll-theme-time-machine (0.2.0) + jekyll (> 3.5, < 5.0) jekyll-seo-tag (~> 2.0) - jekyll-titles-from-headings (0.5.1) - jekyll (~> 3.3) + jekyll-titles-from-headings (0.5.3) + jekyll (>= 3.3, < 5.0) jekyll-watch (2.2.1) listen (~> 3.0) - jemoji (0.10.2) + jemoji (0.12.0) gemoji (~> 3.0) html-pipeline (~> 2.2) - jekyll (~> 3.0) - json (2.3.0) - kramdown (1.17.0) - liquid (4.0.0) - listen (3.1.5) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) - ruby_dep (~> 1.2) + jekyll (>= 3.0, < 5.0) + json (2.6.3) + kramdown (2.3.2) + rexml + kramdown-parser-gfm (1.1.0) + kramdown (~> 2.0) + liquid (4.0.4) + listen (3.8.0) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) mercenary (0.3.6) - mini_portile2 (2.8.0) - minima (2.5.0) - jekyll (~> 3.5) + mini_portile2 (2.8.9) + minima (2.5.1) + jekyll (>= 3.5, < 5.0) jekyll-feed (~> 0.9) jekyll-seo-tag (~> 2.1) - minitest (5.11.3) - multipart-post (2.1.1) - nokogiri (1.13.6) - mini_portile2 (~> 2.8.0) + minitest (5.19.0) + nokogiri (1.18.9) + mini_portile2 (~> 2.8.2) racc (~> 1.4) - octokit (4.14.0) - sawyer (~> 0.8.0, >= 0.5.3) + octokit (4.25.1) + faraday (>= 1, < 3) + sawyer (~> 0.9) pathutil (0.16.2) forwardable-extended (~> 2.6) - public_suffix (3.1.1) - racc (1.6.0) - rb-fsevent (0.10.3) - rb-inotify (0.10.0) + public_suffix (4.0.7) + racc (1.8.1) + rb-fsevent (0.11.2) + rb-inotify (0.10.1) ffi (~> 1.0) - rouge (2.2.1) - ruby-enum (0.7.2) - i18n - ruby_dep (1.5.0) - rubyzip (2.0.0) + rexml (3.4.2) + rouge (3.26.0) + ruby2_keywords (0.0.5) + rubyzip (2.3.2) safe_yaml (1.0.5) sass (3.7.4) sass-listen (~> 4.0.0) sass-listen (4.0.0) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) - sawyer (0.8.2) + sawyer (0.9.2) addressable (>= 2.3.5) - faraday (> 0.8, < 2.0) + faraday (>= 0.17.3, < 3) + simpleidn (0.2.1) + unf (~> 0.1.4) terminal-table (1.8.0) unicode-display_width (~> 1.1, >= 1.1.1) - thread_safe (0.3.6) - typhoeus (1.3.1) + typhoeus (1.4.0) ethon (>= 0.9.0) - tzinfo (1.2.10) - thread_safe (~> 0.1) - unicode-display_width (1.6.0) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + unf (0.1.4) + unf_ext + unf_ext (0.0.8.2) + unicode-display_width (1.8.0) + webrick (1.8.2) PLATFORMS ruby DEPENDENCIES + base64 (~> 0.2.0) + bigdecimal (~> 3.1) + csv (~> 3.3) github-pages json (>= 2.0.0) + webrick (>= 1.8) BUNDLED WITH - 2.0.2 + 2.5.23 diff --git a/_config.yml b/_config.yml index c71405db3..635db0b94 100644 --- a/_config.yml +++ b/_config.yml @@ -7,7 +7,6 @@ repository: elixir-lang/elixir-lang.github.com url: https://elixir-lang.org exclude: - _build/ - - _epub/ - vendor/ - Gemfile - Gemfile.lock @@ -27,3 +26,4 @@ defaults: values: layout: post permalink: /blog/:year/:month/:day/:title/ + image: /images/social/elixir-og-card.jpg diff --git a/_data/elixir-versions.yml b/_data/elixir-versions.yml index 5de459166..468bdabbf 100644 --- a/_data/elixir-versions.yml +++ b/_data/elixir-versions.yml @@ -1,85 +1,88 @@ -stable: v1_13 +stable: v1_19 + +v1_19: + name: v1.19 + minimum_otp: 26.0 + recommended_otp: 28.1 + otp_versions: [28, 27, 26] + version: 1.19.4 + +v1_18: + name: v1.18 + minimum_otp: 26.0 + recommended_otp: 27.3.4 + otp_versions: [27, 26, 25] + version: 1.18.4 + +v1_17: + name: v1.17 + minimum_otp: 25.0 + recommended_otp: 27.1.2 + otp_versions: [27, 26, 25] + version: 1.17.3 + +v1_16: + name: v1.16 + minimum_otp: 24.0 + otp_versions: [26, 25, 24] + version: 1.16.3 + +v1_15: + name: v1.15 + minimum_otp: 24.0 + otp_versions: [26, 25, 24] + version: 1.15.8 + +v1_14: + name: v1.14 + minimum_otp: 23.0 + otp_versions: [25, 24, 23] + version: 1.14.5 v1_13: name: v1.13 minimum_otp: 22.0 + otp_versions: [24, 23, 22] version: 1.13.4 - docs_zip: true v1_12: name: v1.12 minimum_otp: 22.0 + otp_versions: [24, 23, 22] version: 1.12.3 - docs_zip: true v1_11: name: v1.11 minimum_otp: 21.0 + otp_versions: [23, 22, 21] version: 1.11.4 - docs_zip: true v1_10: name: v1.10 minimum_otp: 21.0 + otp_versions: [22, 21] version: 1.10.4 - docs_zip: true v1_9: name: v1.9 minimum_otp: 20.0 + otp_versions: [22, 21, 20] version: 1.9.4 - docs_zip: true v1_8: name: v1.8 minimum_otp: 20.0 + otp_versions: [22, 21, 20] version: 1.8.2 - docs_zip: true v1_7: name: v1.7 minimum_otp: 19.0 + otp_versions: [21, 20, 19] version: 1.7.4 - docs_zip: true v1_6: name: v1.6 minimum_otp: 19.0 + otp_versions: [21, 20, 19] version: 1.6.6 - docs_zip: true - -v1_5: - name: v1.5 - minimum_otp: 18.0 - version: 1.5.3 - docs_zip: true - -v1_4: - name: v1.4 - minimum_otp: 18.0 - version: 1.4.5 - docs_zip: true - -v1_3: - name: v1.3 - minimum_otp: 18.0 - version: 1.3.4 - docs_zip: true - -v1_2: - name: v1.2 - minimum_otp: 18.0 - version: 1.2.6 - docs_zip: true - -v1_1: - name: v1.1 - minimum_otp: 17.0 - version: 1.1.1 - docs_zip: true - -v1_0: - name: v1.0 - minimum_otp: 17.0 - version: 1.0.5 - docs_zip: false diff --git a/_data/getting-started.yml b/_data/getting-started.yml deleted file mode 100644 index 515e578b9..000000000 --- a/_data/getting-started.yml +++ /dev/null @@ -1,123 +0,0 @@ -- title: Getting Started - dir: /getting-started/ - pages: - - title: Introduction - slug: introduction - - - title: Basic types - slug: basic-types - - - title: Basic operators - slug: basic-operators - - - title: Pattern matching - slug: pattern-matching - - - title: case, cond, and if - slug: case-cond-and-if - - - title: Binaries, strings, and charlists - slug: binaries-strings-and-char-lists - - - title: Keyword lists and maps - slug: keywords-and-maps - - - title: Modules and Functions - slug: modules-and-functions - - - title: Recursion - slug: recursion - - - title: Enumerables and streams - slug: enumerables-and-streams - - - title: Processes - slug: processes - - - title: IO and the file system - slug: io-and-the-file-system - - - title: alias, require, and import - slug: alias-require-and-import - - - title: Module attributes - slug: module-attributes - - - title: Structs - slug: structs - - - title: Protocols - slug: protocols - - - title: Comprehensions - slug: comprehensions - - - title: Sigils - slug: sigils - - - title: try, catch, and rescue - slug: try-catch-and-rescue - - - title: Optional syntax sheet - slug: optional-syntax - - - title: Erlang libraries - slug: erlang-libraries - - - title: Debugging - slug: debugging - - - title: Typespecs and behaviours - slug: typespecs-and-behaviours - - - title: Where to go next - slug: where-to-go-next - -- title: Mix and OTP - dir: /getting-started/mix-otp/ - pages: - - title: Introduction to Mix - slug: introduction-to-mix - - - title: Agent - slug: agent - - - title: GenServer - slug: genserver - - - title: Supervisor and Application - slug: supervisor-and-application - - - title: Dynamic supervisors - slug: dynamic-supervisor - - - title: ETS - slug: ets - - - title: Dependencies and umbrella projects - slug: dependencies-and-umbrella-projects - - - title: Task and gen_tcp - slug: task-and-gen-tcp - - - title: Doctests, patterns and with - slug: docs-tests-and-with - - - title: Distributed tasks and tags - slug: distributed-tasks - - - title: Configuration and releases - slug: config-and-releases - - -- title: Meta-programming in Elixir - dir: /getting-started/meta/ - pages: - - title: Quote and unquote - slug: quote-and-unquote - - - title: Macros - slug: macros - - - title: Domain-specific languages - slug: domain-specific-languages diff --git a/_epub/.eslintrc b/_epub/.eslintrc deleted file mode 100644 index 535509b69..000000000 --- a/_epub/.eslintrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "standard", - "env": { - "browser": true - } -} diff --git a/_epub/.formatter.exs b/_epub/.formatter.exs deleted file mode 100644 index d2cda26ed..000000000 --- a/_epub/.formatter.exs +++ /dev/null @@ -1,4 +0,0 @@ -# Used by "mix format" -[ - inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"] -] diff --git a/_epub/.gitignore b/_epub/.gitignore deleted file mode 100644 index 392973856..000000000 --- a/_epub/.gitignore +++ /dev/null @@ -1,20 +0,0 @@ -# The directory Mix will write compiled artifacts to. -/_build/ - -# The directory Mix downloads your dependencies sources to. -/deps/ - -# Ignore .fetch files in case you like to edit your project deps locally. -/.fetch - -# If the VM crashes, it generates a dump, let's ignore it too. -erl_crash.dump - -# Also ignore archive artifacts (built via "mix archive.build"). -*.ez - -# Ignore epub artifacts -*.epub - -# Ignore node deps -/node_modules/ \ No newline at end of file diff --git a/_epub/README.md b/_epub/README.md deleted file mode 100644 index adece76a2..000000000 --- a/_epub/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# Elixir Lang Guides (EPUB format) - -Generate EPUB documents for Elixir guides: - - $ mix epub - -To rebuild assets: - - $ npm install - $ npm run build \ No newline at end of file diff --git a/_epub/assets/less/app.less b/_epub/assets/less/app.less deleted file mode 100644 index 28dcb1820..000000000 --- a/_epub/assets/less/app.less +++ /dev/null @@ -1,109 +0,0 @@ -// Inline code -code.inline { - font-family: courier, monospace; - font-style: normal; - background-color: #f7f9fc; - vertical-align: baseline; - border-radius: 2px; - padding: .1em .2em; -} - -// Block code -pre code { - font-family: courier, monospace; - font-style: normal; - display: block; - overflow-x: auto; - padding: 0.5em; - background: #fdf6e3; - color: #657b83; - .unselectable { - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - } -} - -@default-text-color: #4d4d4c; -/* https://tmbb.github.io/makeup_demo/elixir.html#tango */ -.makeup { - .hll {background-color: #ffffcc} - .bp {color: #3465a4; } /* :name_builtin_pseudo */ - .c {color: #999999; } /* :comment */ - .c1 {color: #999999; } /* :comment_single */ - .ch {color: #999999; } /* :comment_hashbang */ - .cm {color: #999999; } /* :comment_multiline */ - .cp {color: #999999; } /* :comment_preproc */ - .cpf {color: #999999; } /* :comment_preproc_file */ - .cs {color: #999999; } /* :comment_special */ - .dl {color: #4e9a06; } /* :string_delimiter */ - .err {color: #a40000; border: #ef2929; } /* :error */ - .fm {color: @default-text-color; } /* :name_function_magic */ - .g {color: @default-text-color; } /* :generic */ - .gd {color: #a40000; } /* :generic_deleted */ - .ge {color: @default-text-color; font-style: italic; } /* :generic_emph */ - .gh {color: #000080; font-weight: bold; } /* :generic_heading */ - .gi {color: #00A000; } /* :generic_inserted */ - .go {color: @default-text-color; font-style: italic; } /* :generic_output */ - .gp {color: #999999; } /* :generic_prompt */ - .gr {color: #ef2929; } /* :generic_error */ - .gs {color: @default-text-color; font-weight: bold; } /* :generic_strong */ - .gt {color: #a40000; font-weight: bold; } /* :generic_traceback */ - .gu {color: #800080; font-weight: bold; } /* :generic_subheading */ - .il {color: #0000cf; font-weight: bold; } /* :number_integer_long */ - .k {color: #204a87; } /* :keyword */ - .kc {color: #204a87; } /* :keyword_constant */ - .kd {color: #204a87; } /* :keyword_declaration */ - .kn {color: #204a87; } /* :keyword_namespace */ - .kp {color: #204a87; } /* :keyword_pseudo */ - .kr {color: #204a87; } /* :keyword_reserved */ - .kt {color: #204a87; } /* :keyword_type */ - .l {color: @default-text-color; } /* :literal */ - .ld {color: #cc0000; } /* :literal_date */ - .m {color: #2937ab; } /* :number */ - .mb {color: #2937ab; } /* :number_bin */ - .mf {color: #2937ab; } /* :number_float */ - .mh {color: #2937ab; } /* :number_hex */ - .mi {color: #2937ab; } /* :number_integer */ - .mo {color: #2937ab; } /* :number_oct */ - .n {color: @default-text-color; } /* :name */ - .na {color: #c4a000; } /* :name_attribute */ - .nb {color: #204a87; } /* :name_builtin */ - .nc {color: #0000cf; } /* :name_class */ - .nd {color: #5c35cc; font-weight: bold; } /* :name_decorator */ - .ne {color: #cc0000; font-weight: bold; } /* :name_exception */ - .nf {color: #f57900; } /* :name_function */ - .ni {color: #ce5c00; } /* :name_entity */ - .nl {color: #f57900; } /* :name_label */ - .nn {color: @default-text-color; } /* :name_namespace */ - .no {color: #c17d11; } /* :name_constant */ - .nt {color: #204a87; font-weight: bold; } /* :name_tag */ - .nv {color: @default-text-color; } /* :name_variable */ - .nx {color: @default-text-color; } /* :name_other */ - .o {color: #ce5c00; } /* :operator */ - .ow {color: #204a87; } /* :operator_word */ - .p {color: @default-text-color; } /* :punctuation */ - .py {color: @default-text-color; } /* :name_property */ - .s {color: #4e9a06; } /* :string */ - .s1 {color: #4e9a06; } /* :string_single */ - .s2 {color: #4e9a06; } /* :string_double */ - .sa {color: #4e9a06; } /* :string_affix */ - .sb {color: #4e9a06; } /* :string_backtick */ - .sc {color: #4e9a06; } /* :string_char */ - .sd {color: #8f5902; font-style: italic; } /* :string_doc */ - .se {color: #204a87; } /* :string_escape */ - .sh {color: #4e9a06; } /* :string_heredoc */ - .si {color: #204a87; } /* :string_interpol */ - .sr {color: #cc0000; } /* :string_regex */ - .ss {color: #c17d11; } /* :string_symbol */ - .sx {color: #4e9a06; } /* :string_other */ - .sx {color: #4e9a06; } /* :string_sigil */ - .vc {color: @default-text-color; } /* :name_variable_class */ - .vg {color: @default-text-color; } /* :name_variable_global */ - .vi {color: @default-text-color; } /* :name_variable_instance */ - .vm {color: @default-text-color; } /* :name_variable_magic */ - .x {color: @default-text-color; } /* :other */ -} diff --git a/_epub/gulpfile.js b/_epub/gulpfile.js deleted file mode 100644 index a59647d7a..000000000 --- a/_epub/gulpfile.js +++ /dev/null @@ -1,61 +0,0 @@ -// Dependencies -// ------------ - -var gulp = require('gulp') -var $ = require('gulp-load-plugins')({camelize: true}) -var sequence = require('run-sequence') -var del = require('del') -var LessPluginNpmImport = require('less-plugin-npm-import') -var LessPluginAutoPrefix = require('less-plugin-autoprefix') - -// Config -// ------ - -// Set variable via $ gulp --type production -var environment = $.util.env.type || 'development' -var isProduction = environment === 'production' -var distPath = 'priv' - -var npmPlugin = new LessPluginNpmImport() -var autoprefixPlugin = new LessPluginAutoPrefix({ - browsers: ['last 2 versions'] -}) - -// Tasks -// ----- - -gulp.task('clean', function () { - return del(distPath) -}) - -gulp.task('less', function () { - return less({src: 'assets/less/app.less', dest: distPath}) -}) - -gulp.task('build', function (done) { - sequence( - 'clean', - ['less'], - done - ) -}) - -gulp.task('default', ['lint', 'build']) - -var less = function (options) { - return gulp.src(options.src) - .pipe($.less({ - plugins: [ - npmPlugin, - autoprefixPlugin - ] - })) - .pipe($.plumber()) - .pipe($.if(isProduction, $.cleanCss({ - compatibility: 'ie8', - processImport: false - }))) - .pipe($.if(isProduction, $.rev())) - .pipe($.size({title: 'less'})) - .pipe(gulp.dest(options.dest)) -} diff --git a/_epub/lib/elixir_lang_guide.ex b/_epub/lib/elixir_lang_guide.ex deleted file mode 100644 index db7f1d50d..000000000 --- a/_epub/lib/elixir_lang_guide.ex +++ /dev/null @@ -1,322 +0,0 @@ -defmodule ElixirLangGuide do - @moduledoc """ - Generate EPUB documents for Elixir guides. - """ - - @type config :: %{ - guide: String.t(), - homepage: String.t(), - output: Path.t(), - root_dir: Path.t(), - scripts: [Path.t()], - styles: [Path.t()], - images: [Path.t()] - } - - @doc "Generate all guides" - @spec run(Path.t()) :: :ok - def run(source) do - config = %{ - guide: nil, - homepage: "http://elixir-lang.org", - output: "../downloads/books", - root_dir: source, - scripts: [], - styles: assets("priv/app-*.css"), - images: [] - } - - for guide <- ~w(getting_started meta mix_otp) do - config |> Map.put(:guide, guide) |> to_epub() |> log() - end - - :ok - end - - defp assets(path) do - :elixir_lang_guide - |> Application.app_dir(path) - |> Path.wildcard() - end - - defp log(file) do - Mix.shell().info([:green, "Generated guide at #{inspect(file)}"]) - end - - @spec to_epub(config) :: String.t() - defp to_epub(options) do - nav = - options.root_dir - |> Path.expand() - |> Path.join("_data/getting-started.yml") - |> YamlElixir.read_from_file!() - |> generate_nav(options) - - elixir_versions = - options.root_dir - |> Path.expand() - |> Path.join("_data/elixir-versions.yml") - |> YamlElixir.read_from_file!() - - options = Map.put(options, :elixir_versions, elixir_versions) - - nav - |> convert_markdown_pages(options) - |> to_epub(nav, options) - end - - defp generate_nav(yaml, options) do - yaml = - case options.guide do - "getting_started" -> Enum.at(yaml, 0) - "mix_otp" -> Enum.at(yaml, 1) - "meta" -> Enum.at(yaml, 2) - _ -> raise "invalid guide, allowed: `mix_otp`, `meta` or `getting_started`" - end - - for section <- List.wrap(yaml), - %{"slug" => slug, "title" => title} <- section["pages"] do - %{ - id: slug, - label: title, - content: slug <> ".xhtml", - dir: section["dir"], - scripts: List.wrap(options.scripts), - styles: List.wrap(options.styles) - } - end - end - - defp convert_markdown_pages(config, options) do - config - |> Enum.map(&Task.async(fn -> to_xhtml(&1, options) end)) - |> Enum.map(&Task.await(&1, :infinity)) - end - - defp to_xhtml(%{content: path, dir: dir} = nav, options) do - content = - options.root_dir - |> Path.expand() - |> Path.join("#{dir}#{path}") - |> String.replace(".xhtml", ".markdown") - |> File.read!() - |> clean_markdown(options) - |> Earmark.to_html() - |> apply_makeup() - |> to_page(nav) - - unless File.exists?(Path.join(options.output, dir)) do - File.mkdir_p(Path.join(options.output, dir)) - end - - file_path = "#{options.output}#{dir}#{path}" - File.write!(file_path, content) - file_path - end - - defp to_epub(files, nav, options) do - title = - case options.guide do - "getting_started" -> "Elixir Getting Started Guide" - "meta" -> "Meta-programming in Elixir" - "mix_otp" -> "Mix and OTP" - _ -> raise "invalid guide, allowed: `mix_otp`, `meta` or `getting_started`" - end - - images = - case options.guide do - "getting_started" -> - [ - Path.join(options.root_dir, "images/contents/kv-observer.png"), - Path.join(options.root_dir, "images/contents/debugger-elixir.png") - ] - - "mix_otp" -> - [ - Path.join(options.root_dir, "images/contents/kv-observer.png") - ] - - "meta" -> - [] - end - - config = %BUPE.Config{ - title: title, - creator: "elixir-lang.org", - unique_identifier: title_to_filename(title), - source: "#{options.homepage}/getting-started/", - pages: files, - scripts: options.scripts, - styles: options.styles, - images: images, - nav: nav - } - - output_file = "#{options.output}/#{title_to_filename(title)}.epub" - BUPE.build(config, output_file) - delete_generated_files(files) - Path.relative_to_cwd(output_file) - end - - defp delete_generated_files(files) do - Enum.map(files, &File.rm!(&1)) - end - - defp title_to_filename(title) do - title |> String.replace(" ", "-") |> String.downcase() - end - - defp clean_markdown(content, options) do - content - |> remove_includes() - |> remove_variables(options) - |> remove_span_hidden_hack() - |> remove_raw_endraw_tags() - |> remove_frontmatter() - |> fix_backslashes() - |> fix_images() - |> fix_js() - |> map_links(options) - end - - defp remove_includes(content) do - content - |> String.replace("{% include toc.html %}", "") - |> String.replace("{% include mix-otp-preface.html %}", "") - end - - defp remove_variables(content, options) do - %{"stable" => current_stable_version} = elixir_versions = Map.get(options, :elixir_versions) - stable = elixir_versions[current_stable_version] - - content - |> String.replace( - "{% assign stable = site.data.elixir-versions[site.data.elixir-versions.stable] %}", - "" - ) - |> String.replace("{{ stable.version }}", "#{stable["version"]}") - |> String.replace("{{ stable.minimum_otp }}", "#{stable["minimum_otp"]}") - end - - # The is a hack used in pattern-matching.md - defp remove_span_hidden_hack(content) do - String.replace(content, ~r/# {{ page.title }}(