mkwebook 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a7e29166ba302805e68e70779ef8de58870671aab0ae684d1cec2290f5a0b4bf
4
- data.tar.gz: 5e530d48d11ce6c26ac5255b7b294b15b6f90bde7b4ecc4e36ee2bc0e0ea7d54
3
+ metadata.gz: 0caf9753412a2f7479f03a442361ad896c31982ca7225f604311f286d1111685
4
+ data.tar.gz: 2502a70592588c4b2e62c3c36a5ae38b9801109ac8a8eba3d449f9be50088261
5
5
  SHA512:
6
- metadata.gz: 1b90f0fbd51ad20e65847ca7fde950fc40651c3639a24f28b73c52580547e19e9b93f8e8a60247e3d56046afd2cfb9d758a5903c569b871093c841ad2513a52b
7
- data.tar.gz: f5f17d96c4700ddd423fffe592a702812049a21e65ee113cccf12ba5c38b3dbc8af9a1307711ec96c03e4757e12a68c586e15497d33ccbf99e036078962e7cca
6
+ metadata.gz: c32259253e673b94040eea46bcbbd4356b5dcc9622943892c32a343029863eb6c059e7a6b45981d3c03e8fc90a7aaf475f5d952d2e4fa315796f5658dcb1e7b4
7
+ data.tar.gz: f18163c7ec7a720ba600ae9d3a66d48f7df350d3c59dfd2b903f17bdeacc81bf419e6e1ecab858ee26c674078ed853c3f60c99a70643f01f9b100546828a324b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mkwebook (0.1.2)
4
+ mkwebook (0.1.3)
5
5
  activesupport (>= 6.1.5)
6
6
  concurrent-ruby
7
7
  ferrum (>= 0.13)
@@ -1,3 +1,3 @@
1
1
  module Mkwebook
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -1,49 +1,49 @@
1
- browser: # browser settings
2
- headless: false # headless mode
3
- window_size: [1440, 1024] # browser window size
1
+ browser: # browser settings, this setting is optional
2
+ headless: false # headless mode, the -H CLI option could be used to override this setting
3
+ window_size: [1920, 1200] # browser window size
4
4
  timeout: 30 # timeout for waiting for page loading
5
5
  # Any options accepted by Ferum::Browser.new are allowed here
6
6
 
7
7
  concurrency: 16 # number of concurrent threads, default is no conccurency
8
8
 
9
- authentication: # authentication settings
9
+ authentication: # authentication settings, this setting is optional
10
10
  url: https://example.com/login # any page url which for inject cookie and local storage
11
11
  cookies: "auth_cookie_id=demo" # cookie string to be injected
12
12
  local-storage: # local storage to be injected
13
13
  username: demo # key and value
14
14
  auth_token: demo # key and value
15
15
 
16
- index-page: # index page settings
16
+ index-page: # index page settings, this setting is mandatory
17
17
  url: https://clojure.org/guides/repl/introduction # URL of index page
18
18
  title: Clojure Guides # title for the book, use page's title if not set
19
- modifier: | # JavaScript code to modify the page
19
+ modifier: | # JavaScript code to modify the page, this setting is optional
20
20
  document.body.innerHTML = document.querySelector('.clj-section-nav-container').outerHTML;
21
21
  document.querySelector('.clj-section-nav-container').style.width = '100%';
22
22
  document.body.style.backgroundColor = 'white';
23
23
 
24
- selector: "html" # CSS selector for the content to be saved
25
- output: "index.html" # output file name
26
- link-selector: "a:not([href='../guides'])" # CSS selector for links of content pages
27
- assets: # assets to be downloaded
24
+ selector: "html" # CSS selector for the content to be saved, this setting is mandatory
25
+ output: "index.html" # output file name, this setting is mandatory
26
+ link-selector: "a:not([href='../guides'])" # CSS selector for links of content pages, this setting is mandatory
27
+ assets: # assets to be downloaded, this setting is optional
28
28
  - selector: "link[rel=stylesheet]" # CSS selector for assets
29
29
  attr: href # attribute name for the asset URL
30
30
  - selector: "script[src]"
31
31
  attr: src
32
32
 
33
- max-recursion: 2 # max depth of recursive downloading
33
+ max-recursion: 2 # max depth of recursive downloading, default is 1
34
34
 
35
- pages: # settings for content pages
35
+ pages: # settings for content pages, this setting is mandatory
36
36
  - url-pattern: '.*' # URL pattern for content page, only pages' URL matching this pattern will be processed
37
- modifier: | # JavaScript code to modify the page
37
+ modifier: | # JavaScript code to modify the page, this setting is optional
38
38
  document.body.innerHTML = document.querySelector('.clj-content-container').outerHTML;
39
39
  document.querySelector('.clj-content-container').style.width = '100%';
40
40
  document.body.style.backgroundColor = 'white';
41
41
  var style = document.createElement('style');
42
42
  style.innerHTML = '.clj-content-container { margin-left: 0; }';
43
43
  document.body.appendChild(style);
44
- selector: html # CSS selector for the content to be saved
45
- page-link-selector: "a:not([href='../guides'])" # links to be downloaded recursively which are extracted from page content
46
- assets: # assets to be downloaded
44
+ selector: html # CSS selector for the content to be saved, this setting is mandatory
45
+ page-link-selector: "a:not([href='../guides'])" # links to be downloaded recursively which are extracted from page content, this setting is optional, if this setting is set, consider also set max-recursion
46
+ assets: # assets to be downloaded, this setting is optional
47
47
  - selector: img # CSS selector for assets
48
48
  attr: src # attribute name for the asset URL
49
49
  - selector: "link[rel=stylesheet]"
@@ -51,20 +51,20 @@ pages: # settings for content pages
51
51
  - selector: "script[src]"
52
52
  attr: src
53
53
 
54
- extra-pages: # settings for extra pages
54
+ extra-pages: # settings for extra pages, this setting is optional
55
55
  - https://www.example.com/extra-page-1
56
56
 
57
- post-process: | # Shell script to be executed after the book is downloaded
57
+ post-process: | # Shell script to be executed after the book is downloaded, this setting is optional
58
58
  find . -name '*.html' -exec sed -i 's/https:\/\/clojure.org\/guides\/repl\/introduction/..\/index.html/g' {} \;
59
59
 
60
- docset: # config for generate docset
61
- name: "Clojure Guides" # docset name
62
- keyword: "clojure" # docset keyword
63
- icon: "clojure.png" # docset icon
64
- index: "/index.html" # docset index page
60
+ docset: # config for generate docset, mandatory if run docset command
61
+ name: "Clojure Guides" # docset name, this setting is mandatory
62
+ keyword: "clojure" # docset keyword, this setting is mandatory
63
+ icon: "clojure.png" # docset icon, this setting is mandatory
64
+ index: "/index.html" # docset index page, this setting is mandatory
65
65
  pages: # docset pages config
66
66
  - url-pattern: 'index.html' # URL pattern for docset page, will match against local downloaded pages
67
- extractor: | # JavaScript code to extract the content for docset page
67
+ extractor: | # JavaScript code to extract the content for docset page, this setting is mandatory
68
68
  (function() {
69
69
  var links = [...document.querySelectorAll('a.data-url')];
70
70
  return links.map(link => {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mkwebook
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Liu Xiang