mkwebook 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/mkwebook/version.rb +1 -1
- data/lib/template/mkwebook.yml +24 -24
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0caf9753412a2f7479f03a442361ad896c31982ca7225f604311f286d1111685
|
4
|
+
data.tar.gz: 2502a70592588c4b2e62c3c36a5ae38b9801109ac8a8eba3d449f9be50088261
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c32259253e673b94040eea46bcbbd4356b5dcc9622943892c32a343029863eb6c059e7a6b45981d3c03e8fc90a7aaf475f5d952d2e4fa315796f5658dcb1e7b4
|
7
|
+
data.tar.gz: f18163c7ec7a720ba600ae9d3a66d48f7df350d3c59dfd2b903f17bdeacc81bf419e6e1ecab858ee26c674078ed853c3f60c99a70643f01f9b100546828a324b
|
data/Gemfile.lock
CHANGED
data/lib/mkwebook/version.rb
CHANGED
data/lib/template/mkwebook.yml
CHANGED
@@ -1,49 +1,49 @@
|
|
1
|
-
browser: # browser settings
|
2
|
-
headless: false # headless mode
|
3
|
-
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 => {
|