Polishing documentation

This commit is contained in:
Dimitry Ivanov 2019-03-15 19:29:52 +03:00
parent 6098bcc652
commit ab74222c54
6 changed files with 35 additions and 64 deletions

View File

@ -2,9 +2,6 @@
# Markwon # Markwon
![stable](https://img.shields.io/maven-central/v/ru.noties.markwon/core.svg?label=stable)
![snapshot](https://img.shields.io/nexus/s/https/oss.sonatype.org/ru.noties.markwon/core.svg?label=snapshot)
[![Build Status](https://travis-ci.org/noties/Markwon.svg?branch=master)](https://travis-ci.org/noties/Markwon) [![Build Status](https://travis-ci.org/noties/Markwon.svg?branch=master)](https://travis-ci.org/noties/Markwon)
**Markwon** is a markdown library for Android. It parses markdown **Markwon** is a markdown library for Android. It parses markdown
@ -30,6 +27,10 @@ features listed in [commonmark-spec] are supported
[sample-apk]: https://github.com/noties/Markwon/releases [sample-apk]: https://github.com/noties/Markwon/releases
## Installation ## Installation
![stable](https://img.shields.io/maven-central/v/ru.noties.markwon/core.svg?label=stable)
![snapshot](https://img.shields.io/nexus/s/https/oss.sonatype.org/ru.noties.markwon/core.svg?label=snapshot)
```groovy ```groovy
implementation "ru.noties.markwon:core:${markwonVersion}" implementation "ru.noties.markwon:core:${markwonVersion}"
``` ```

View File

@ -3,38 +3,36 @@
<div class="artifact-container"> <div class="artifact-container">
<div v-for="artifact in artifacts" class="artifact" @click="toggleSelection(artifact)"> <div v-for="artifact in artifacts" class="artifact" @click="toggleSelection(artifact)">
<div class="artifact-header"> <div class="artifact-header">
<input <input type="checkbox" v-model="selected" :value="artifact.id" :id="artifact.id">
type="checkbox" <strong>
v-model="selected" <label :for="artifact.id">{{artifact.name}}</label>
:value="artifact.id" </strong>
:id="artifact.id" />
<strong><label :for="artifact.id">{{artifact.name}}</label></strong>
</div> </div>
<div class="artifact-description" v-if="artifact.description">{{artifact.description}}</div> <div class="artifact-description" v-if="artifact.description">{{artifact.description}}</div>
</div> </div>
</div> </div>
<div <div class="extra-class language-gradle selected-artifacts" v-if="selected.length > 0">
class="extra-class language-gradle selected-artifacts"
v-if="selected.length > 0"
@click="selectAll"
>
<div class="selected-artifact-script"> <div class="selected-artifact-script">
<span class="token keyword">final def</span>&nbsp;markwon_version =&nbsp;<span class="token string">'{{latestVersion}}'</span> <span class="token keyword">final def</span>
<span>&nbsp;markwon_version =&nbsp;</span>
<span class="token string">'{{latestVersion}}'</span>
</div> </div>
<br> <br>
<div class="selected-artifact-script" v-for="artifact in selectedArtifacts"> <div class="selected-artifact-script" v-for="artifact in selectedArtifacts">
<span>implementation&nbsp;</span><span class="token string">"{{artifact.group}}:{{artifact.id}}:</span><span>$markwon_version</span><span class="token string">"</span> <span>implementation&nbsp;</span>
<span class="token string">"{{artifact.group}}:{{artifact.id}}:</span>
<span>$markwon_version</span>
<span class="token string">"</span>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { artifacts } from "../.artifacts.js";
import {artifacts} from '../.artifacts.js';
if (!artifacts) { if (!artifacts) {
throw 'Artifacts not found. Use `collectArtifacts.js` script to obtain artifacts metadata.' throw "Artifacts not found. Use `collectArtifacts.js` script to obtain artifacts metadata.";
} }
export default { export default {
@ -42,36 +40,18 @@ export default {
data() { data() {
return { return {
artifacts, artifacts,
selected: ['core'], selected: ["core"],
latestVersion: 'latest_version' latestVersion: "latest_version"
}; };
}, },
methods: { methods: {
selectAll(e) {
let el = e.target;
while (!el.classList.contains("selected-artifacts")) {
el = el.parentElement;
}
if (document.body.createTextRange) {
const range = document.body.createTextRange();
range.moveToElementText(el);
range.select();
} else if (window.getSelection) {
const selection = window.getSelection();
const range = document.createRange();
range.selectNodeContents(el);
selection.removeAllRanges();
selection.addRange(range);
}
},
toggleSelection(artifact) { toggleSelection(artifact) {
const index = this.selected.indexOf(artifact.id) const index = this.selected.indexOf(artifact.id);
if (index < 0) { if (index < 0) {
this.selected.push(artifact.id); this.selected.push(artifact.id);
} else { } else {
this.selected.splice(index, 1); this.selected.splice(index, 1);
} }
} }
}, },
computed: { computed: {
@ -100,8 +80,8 @@ export default {
max-width: 10em; max-width: 10em;
} }
.artifact-description { .artifact-description {
font-size: 0.85em; font-size: 0.85em;
margin-top: 0.5em; margin-top: 0.5em;
} }
.selected-artifacts { .selected-artifacts {
color: white; color: white;
@ -119,6 +99,7 @@ export default {
margin-top: 0.5em; margin-top: 0.5em;
} }
.selected-artifact-script { .selected-artifact-script {
display: block; display: flex;
flex-wrap: wrap;
} }
</style> </style>

View File

@ -70,10 +70,5 @@ module.exports = {
}, },
sidebarDepth: 2, sidebarDepth: 2,
lastUpdated: true lastUpdated: true
},
markdown: {
config: md => {
md.use(require('markdown-it-task-lists'));
}
} }
} }

View File

@ -52,11 +52,11 @@ listed in <Link name="commonmark-spec" /> are supported (including support for *
* there is support to render any HTML tag, but it will require to create a special `TagHandler`, * there is support to render any HTML tag, but it will require to create a special `TagHandler`,
more information can be found in [HTML section](/docs/v3/core/html-renderer.md) more information can be found in [HTML section](/docs/v3/core/html-renderer.md)
* [Task lists](/docs/v3/ext-tasklist/): * [Task lists](/docs/v3/ext-tasklist/):
- [ ] Not _done_ <ul style="list-style-type: none; margin: 0; padding: 0;">
- [X] **Done** with `X` <li><input type="checkbox" disabled>Not <i>done</i></li>
- [x] ~~and~~ **or** small `x` <li><input type="checkbox" disabled checked><strong>Done</strong> with <code>X</code></li>
<li><input type="checkbox" disabled checked><del>and</del> <strong>or</strong> small <code>x</code></li>
<small><em><sup>*</sup> Task-lists are not properly displayed on this web-site, library renders them correctly</em></small> </ul>
## Screenshots ## Screenshots

View File

@ -5718,11 +5718,6 @@
"resolved": "https://registry.npmjs.org/markdown-it-table-of-contents/-/markdown-it-table-of-contents-0.4.3.tgz", "resolved": "https://registry.npmjs.org/markdown-it-table-of-contents/-/markdown-it-table-of-contents-0.4.3.tgz",
"integrity": "sha512-x/OdaRzLYxAjmB+jIVlXuE3nX7tZTLDQxm58RkgjTLyQ+I290jYQvPS9cJjVN6SM3U6K6CHKYNgUtPNZmLblYQ==" "integrity": "sha512-x/OdaRzLYxAjmB+jIVlXuE3nX7tZTLDQxm58RkgjTLyQ+I290jYQvPS9cJjVN6SM3U6K6CHKYNgUtPNZmLblYQ=="
}, },
"markdown-it-task-lists": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/markdown-it-task-lists/-/markdown-it-task-lists-2.1.1.tgz",
"integrity": "sha512-TxFAc76Jnhb2OUu+n3yz9RMu4CwGfaT788br6HhEDlvWfdeJcLUsxk1Hgw2yJio0OXsxv7pyIPmvECY7bMbluA=="
},
"math-expression-evaluator": { "math-expression-evaluator": {
"version": "1.2.17", "version": "1.2.17",
"resolved": "https://registry.npmjs.org/math-expression-evaluator/-/math-expression-evaluator-1.2.17.tgz", "resolved": "https://registry.npmjs.org/math-expression-evaluator/-/math-expression-evaluator-1.2.17.tgz",

View File

@ -4,7 +4,6 @@
}, },
"dependencies": { "dependencies": {
"commonmark": "^0.28.1", "commonmark": "^0.28.1",
"markdown-it-task-lists": "^2.1.1",
"vuepress": "^0.14.2" "vuepress": "^0.14.2"
} }
} }