File tree Expand file tree Collapse file tree 8 files changed +65
-80
lines changed Expand file tree Collapse file tree 8 files changed +65
-80
lines changed Original file line number Diff line number Diff line change 6
6
< title > complex-loader example</ title >
7
7
</ head >
8
8
< body >
9
- < div id ="header "> complex-loader</ div >
10
- < div id ="slides ">
11
- < div class ="side-bar ">
12
- < nav >
13
- < a v-bind:href ="section.href " v-for ="section in sections ">
14
- {{ section.text }}
15
- </ a >
16
- </ nav >
17
- </ div >
18
- < div class ="slide-left ">
19
- < h2 > Source</ h2 >
20
- < div >
21
- < div v-html ="markdownSource " class ="markdown-body "> </ div >
22
- </ div >
23
- </ div >
24
- < div class ="slide-right ">
25
- < h2 > Development</ h2 >
26
- < div >
27
- < summary >
28
- < p > All model of this page gotten by only one import:</ p >
29
- < pre v-highlightjs > < code class ="javascript "> {{ exampleImport }}</ code > </ pre >
30
- < p > The result of import is an object with exhaustive information about the target file. In this particular case - README.md:</ p >
31
- < pre v-highlightjs ="metadata "> < code class ="json "> </ code > </ pre >
32
- < p > The work of import is ensured by the following rule:</ p >
33
- < pre v-highlightjs ="webpackConfig "> < code class ="javascript "> </ code > </ pre >
34
- </ summary >
35
- </ div >
36
- </ div >
37
- </ div >
9
+ < div id ="root "> </ div >
38
10
< script type ="text/javascript " src ="bundle.js "> </ script > </ body >
39
11
</ html >
Original file line number Diff line number Diff line change 6
6
< title > complex-loader example</ title >
7
7
</ head >
8
8
< body >
9
- < div id ="header "> complex-loader</ div >
10
- < div id ="slides ">
11
- < div class ="side-bar ">
12
- < nav >
13
- < a v-bind:href ="section.href " v-for ="section in sections ">
14
- {{ section.text }}
15
- </ a >
16
- </ nav >
17
- </ div >
18
- < div class ="slide-left ">
19
- < h2 > Source</ h2 >
20
- < div >
21
- < div v-html ="markdownSource " class ="markdown-body "> </ div >
22
- </ div >
23
- </ div >
24
- < div class ="slide-right ">
25
- < h2 > Development</ h2 >
26
- < div >
27
- < summary >
28
- < p > All model of this page gotten by only one import:</ p >
29
- < pre v-highlightjs > < code class ="javascript "> {{ exampleImport }}</ code > </ pre >
30
- < p > The result of import is an object with exhaustive information about the target file. In this particular case - README.md:</ p >
31
- < pre v-highlightjs ="metadata "> < code class ="json "> </ code > </ pre >
32
- < p > The work of import is ensured by the following rule:</ p >
33
- < pre v-highlightjs ="webpackConfig "> < code class ="javascript "> </ code > </ pre >
34
- </ summary >
35
- </ div >
36
- </ div >
37
- </ div >
9
+ < div id ="root "> </ div >
38
10
</ body >
39
11
</ html >
Original file line number Diff line number Diff line change @@ -162,7 +162,6 @@ The loader has not yet been tested in all the nuances. The caching method has no
162
162
163
163
For now there is few doubtful moments:
164
164
165
- - The function for generate loader unique id (` getPlayerUid ` ) is unreliable. Maybe there is a way to improve it?
166
165
- Should I implement in-build nesting? For now you can created nested structures only by defining ` complex-loader ` again as child loader. But why not make support for nested objects? And how in this case to distinguish the nested object is a shape of the loader?
167
166
- Support functional loaders. Now there is opportunity to pass directly the function as a loader, instead of the string. May it be in demand?
168
167
- Caching options - it is good or bad? And what underwater rocks awaits us here?
Original file line number Diff line number Diff line change @@ -3,14 +3,17 @@ import VueHighlightJS from './directives/highlightjs.js'
3
3
import 'github-markdown-css/github-markdown.css'
4
4
import readme from './README.md'
5
5
import webpackConfig from '../config/markdown.rule.js'
6
+ import template from './templates/content.html'
6
7
import './style.css'
7
8
import './highlight.css'
8
9
9
10
// Tell Vue.js to use vue-highlightjs
10
11
Vue . use ( VueHighlightJS )
11
12
13
+ console . log ( 'readme' , readme )
14
+
12
15
new Vue ( {
13
- el : '#slides ' ,
16
+ el : '#root ' ,
14
17
data : {
15
18
markdownSource : readme . content ,
16
19
metadata : JSON . stringify (
@@ -28,13 +31,8 @@ new Vue({
28
31
. replace ( / [ \s ] + / g, '-' ) ,
29
32
text
30
33
} ) ) ,
31
- exampleImport : `import readme from '../../README.md'`
32
- } ,
33
- } )
34
-
35
- new Vue ( {
36
- el : '#header' ,
37
- data : {
38
- title : readme . heading ,
34
+ exampleImport : `import readme from './README.md'` ,
35
+ title : readme . metadata . heading ,
39
36
} ,
37
+ template
40
38
} )
Original file line number Diff line number Diff line change @@ -8,6 +8,11 @@ body, html {
8
8
box-sizing : border-box;
9
9
}
10
10
11
+ # root {
12
+ height : 100vh ;
13
+ overflow : hidden;
14
+ }
15
+
11
16
# slides {
12
17
display : flex;
13
18
overflow : hidden;
Original file line number Diff line number Diff line change
1
+ < div >
2
+ < div id ="header "> {{ title }}</ div >
3
+ < div id ="slides ">
4
+ < div class ="side-bar ">
5
+ < nav >
6
+ < a v-bind:href ="section.href " v-for ="section in sections ">
7
+ {{ section.text }}
8
+ </ a >
9
+ </ nav >
10
+ </ div >
11
+ < div class ="slide-left ">
12
+ < h2 > Source</ h2 >
13
+ < div >
14
+ < div v-html ="markdownSource " class ="markdown-body "> </ div >
15
+ </ div >
16
+ </ div >
17
+ < div class ="slide-right ">
18
+ < h2 > Development</ h2 >
19
+ < div >
20
+ < summary >
21
+ < p > All model of this page gotten by only one import:</ p >
22
+ < pre v-highlightjs > < code class ="javascript "> {{ exampleImport }}</ code > </ pre >
23
+ < p > The result of import is an object with exhaustive information about the target file. In this particular case - README.md:</ p >
24
+ < pre v-highlightjs ="metadata "> < code class ="json "> </ code > </ pre >
25
+ < p > The work of import is ensured by the following rule:</ p >
26
+ < pre v-highlightjs ="webpackConfig "> < code class ="javascript "> </ code > </ pre >
27
+ </ summary >
28
+ </ div >
29
+ </ div >
30
+ </ div >
31
+ </ div >
Original file line number Diff line number Diff line change @@ -46,6 +46,10 @@ module.exports = {
46
46
}
47
47
]
48
48
} ,
49
+ {
50
+ test : / \. h t m l $ / ,
51
+ use : 'raw-loader'
52
+ } ,
49
53
{
50
54
test : / \. p n g $ / ,
51
55
exclude : / n o d e _ m o d u l e s / ,
You can’t perform that action at this time.
0 commit comments