coursegen 0.9.8 → 0.9.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6e795fda87f36793e17eacef4c0f6215b71c737acd921470f7328e311738f5b2
4
- data.tar.gz: 657d2df1548654f5fb29ada51658878ac5eb87e056a42c8bfd96fda31952c783
3
+ metadata.gz: 03f1cff6597ed85fbcde71668cb790bb234d1c529d69e8dd5b2590b8fdbb029c
4
+ data.tar.gz: 17b93ad8dda84b6a73ea6f1f9c7ae01a2e8380ee693bf34b6823bfd2f0416724
5
5
  SHA512:
6
- metadata.gz: 03a0a6ed44e0e53ad19fdd2709123efb44527f2d2928365db32f518b59971ffddbb7079f442786677ae54a4f86fc686a452b2930a14841db2fd829e00ac752d2
7
- data.tar.gz: d3596fcd8741f91ea19b2ffcfb4c428665740ac956e9e33b12a64819421dd86c7088081bfec792ffb13a4687a021d0ef743a0c06ed6ac7db010972bf8d3f5ca6
6
+ metadata.gz: 471215f376cbd6990e4ae3fd1f0929e809c9f933019ca9398719d23bb79344cfd6725625bb4a2f515c88db5a90ea8b4553da16525822b115828cab79c8c78745
7
+ data.tar.gz: d5d69b84ef364720ac4172e8906bbff350f838b8481c7d49aca9893634460f9698beedfc9005469257e06cc28c12b581deb42d7b88fe58207f4b416ed4ba96e1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- coursegen (0.9.8)
4
+ coursegen (0.9.9)
5
5
  activesupport
6
6
  adsf
7
7
  byebug
@@ -1,9 +1,19 @@
1
1
  include VisualHelpers
2
2
 
3
3
  Nanoc::Filter.define(:handle_shortcodes) do |content, _params = {}|
4
+ prefix = /:/
4
5
  content
5
- .gsub(/^\$\$INCLUDE_TOPIC :(\w+)$/) { "<%= include_topic( :#{$1}) %>" }
6
- .gsub(/^\$\$SLIDE_TITLE (.+)$/) { "<slide_break></slide_break>\n\n### #{$1}" }
6
+ .gsub(/^\$\$TOPIC_INCLUDE :(\w+)$/) { "<%= include_topic( :#{Regexp.last_match(1)}) %>" }
7
+ .gsub(/\$\$TOPIC_LINK :(\w+)$/) { "<%= link_to_topic( :#{Regexp.last_match(1)}) %>" }
8
+ .gsub(/^\$\$SLIDE_TITLE (.+)$/) { "<slide_break></slide_break>\n\n### #{Regexp.last_match(1)}" }
7
9
  .gsub(/^\$\$SLIDE_BREAK$/) { "<slide_break></slide_break>" }
8
- .gsub(/^\$\$END_OF_LECTURE$/) { end_of_lecture }
9
- end
10
+ .gsub(/^\$\$LECTURE_END$/) { end_of_lecture }
11
+ .gsub(/^\$\$LECTURE_BEGIN (.+)$/) { "## #{Regexp.last_match(1)} "}
12
+ .gsub(Regexp.new(prefix.source + /h1 (.+)$/.source), "# \\1 ")
13
+ .gsub(Regexp.new(prefix.source + /h2 (.+)$/.source), "## \\1 ")
14
+ .gsub(Regexp.new(prefix.source + /h3 (.+)$/.source), "### \\1 ")
15
+ .gsub(Regexp.new(prefix.source + /topic_include :(\w+)$/.source), "<%= include_topic( :\\1) %>")
16
+ .gsub(Regexp.new(prefix.source + /topic_link :(\w+)$/.source), "<%= link_to_topic( :\\1) %>")
17
+ .gsub(Regexp.new(prefix.source + /slide_title (.+)$/.source), "<slide_break></slide_break>\n\n### \\1")
18
+ .gsub(Regexp.new(prefix.source + /lecture_end/.source), end_of_lecture)
19
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Coursegen
4
- VERSION = '0.9.8'
4
+ VERSION = '0.9.9'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coursegen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.8
4
+ version: 0.9.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pito Salas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-27 00:00:00.000000000 Z
11
+ date: 2021-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler