Skip to content

Commit 0ee3885

Browse files
authored
Merge pull request #99 from grapoza/convert-docs-to-pandoc
Converts documentation to pandoc in gh-pages
2 parents f815e77 + 763e46c commit 0ee3885

File tree

21 files changed

+310
-184
lines changed

21 files changed

+310
-184
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,8 @@ yarn-error.log*
2121
*.sln
2222
*.sw*
2323

24+
# Documentation output
25+
/docs/output
26+
27+
# Local scratchpad document
2428
scratchpad.md

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2018 Gregg Rapoza
3+
Copyright (c) 2019 Gregg Rapoza
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

appveyor.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ init:
77
- sh: nvm use 8
88

99
install:
10+
# Get the app version from the package.json's version property, and set the build number
1011
- ps: $env:package_version = (Get-Content -Raw -Path package.json | ConvertFrom-Json).version
1112
- ps: Update-AppveyorBuild -Version "$env:package_version-$env:APPVEYOR_BUILD_NUMBER"
1213

@@ -32,8 +33,40 @@ deploy_script:
3233
- ps: |
3334
if ($env:APPVEYOR_REPO_TAG -eq "true")
3435
{
36+
# Publish the package
3537
# npm_auth_token defined in the appveyor project on the site. https://www.appveyor.com/docs/lang/nodejs-iojs/#authenticating-npm-for-publishing-packages
3638
"//registry.npmjs.org/:_authToken=$env:npm_auth_token`n" | out-file (Join-Path $Home "/.npmrc") -Encoding ASCII
3739
npm publish package/ --access public
3840
}
41+
42+
after_deploy:
43+
- sh: |
44+
if [ ${APPVEYOR_REPO_TAG} == "true" ]; then
45+
# Install pandoc (the apt-get version is way out of date, so manually download the package)
46+
mkdir -p ../wgetdeb
47+
wget -P ../wgetdeb https://github.com/jgm/pandoc/releases/download/2.7.3/pandoc-2.7.3-1-amd64.deb
48+
sudo apt-get --assume-yes install ../wgetdeb/pandoc-2.7.3-1-amd64.deb
49+
fi
50+
# Generate and update docs
51+
- ps: |
52+
if ($env:APPVEYOR_REPO_TAG -eq "true")
53+
{
54+
# Publish the docs to the gh-pages branch
55+
# github_auth_token defined in the appveyor project on the site. https://www.appveyor.com/docs/how-to/git-push/
56+
cd docs
57+
.\generateDocs.ps1
58+
cd ..\..
59+
git clone --depth=1 --branch=gh-pages https://$($env:github_auth_token):x-oauth-basic@github.com/grapoza/vue-tree.git "pagesbranch" 2>&1 | % { $_.ToString() }
60+
cd pagesbranch
61+
Copy-Item -Path "..\vue-tree\docs\output" -Destination ".\$env:package_version" -Recurse
62+
git add "$env:package_version"
63+
New-Item -Path . -Name "index.html" -ItemType "file" -Value "<html><head><title>Redirect</title></head><body><script>window.location.replace(`"https://grapoza.github.io/vue-tree/$env:package_version/`");</script></body></html>" -Force
64+
git add index.html
65+
git config credential.helper store
66+
Add-Content "$HOME\.git-credentials" "https://$($env:github_auth_token):x-oauth-basic@github.com`n"
67+
git config user.email "grapoza+appveyor@gmail.com"
68+
git config user.name "Gregg Rapoza (via AppVeyor)"
69+
git commit -m "AppVeyor commit of docs for version $env:package_version"
70+
git push
71+
}
3972
...

docs/_config.yml

Lines changed: 0 additions & 2 deletions
This file was deleted.

docs/_layouts/default.html

Lines changed: 0 additions & 66 deletions
This file was deleted.

docs/_layouts/demo.html

Lines changed: 0 additions & 72 deletions
This file was deleted.

docs/_sass/_custom.scss

Lines changed: 0 additions & 9 deletions
This file was deleted.

docs/assets/css/style.scss

Lines changed: 0 additions & 5 deletions
This file was deleted.

docs/demo/addRemove.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
---
2-
layout: demo
3-
---
2+
title-prefix: Add/Delete Demo
3+
...
4+
5+
[Back to Demos list](/demos.html)
46

57
## Add/Remove Nodes Demo
68

79
This page demonstrates adding and removing nodes. [See the data used](./addRemove.js). The callback for adding nodes is set in `modelDefaults` so any newly created node will use the same creation method automatically.
810

9-
{% raw %}
11+
```{=html5}
1012
<div id="app">
1113
<tree id="customtree" :initial-model="model" :model-defaults="modelDefaults" ref="tree"></tree>
1214
</div>
13-
{% endraw %}
1415
1516
<script type='module'>
1617
import arModel from './addRemove.js';
@@ -29,10 +30,11 @@ This page demonstrates adding and removing nodes. [See the data used](./addRemov
2930
};
3031
},
3132
methods: {
32-
addChildCallback (parentModel) {
33+
addChildCallback(parentModel) {
3334
this.childCounter++;
3435
return Promise.resolve({ id: `child-node${this.childCounter}`, label: `Added Child ${this.childCounter}`, deletable: true });
3536
}
3637
}
3738
}).$mount('#app');
38-
</script>
39+
</script>
40+
```

docs/demo/basic.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
---
2-
layout: demo
3-
---
2+
title-prefix: Basic Checkboxes Demo
3+
...
4+
5+
[Back to Demos list](/demos.html)
46

57
## Basic Treeview Checkbox Demo
68

79
This page demonstrates a basic treeview using checkboxes, with some nodes that are expanded, checked, and/or disabled by default. [See the data used](./basic.js).
810

9-
{% raw %}
11+
```{=html5}
1012
<div id="app">
1113
<tree id="customtree" :initial-model="model" ref="tree"></tree>
1214
<section id="checkedStuff">
@@ -16,7 +18,6 @@ This page demonstrates a basic treeview using checkboxes, with some nodes that a
1618
</ul>
1719
</section>
1820
</div>
19-
{% endraw %}
2021
2122
<script type='module'>
2223
import basicData from './basic.js';
@@ -37,4 +38,5 @@ This page demonstrates a basic treeview using checkboxes, with some nodes that a
3738
}
3839
}
3940
}).$mount('#app');
40-
</script>
41+
</script>
42+
```

0 commit comments

Comments
 (0)