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
![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)
**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
## 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
implementation "ru.noties.markwon:core:${markwonVersion}"
```

View File

@ -3,38 +3,36 @@
<div class="artifact-container">
<div v-for="artifact in artifacts" class="artifact" @click="toggleSelection(artifact)">
<div class="artifact-header">
<input
type="checkbox"
v-model="selected"
:value="artifact.id"
:id="artifact.id" />
<strong><label :for="artifact.id">{{artifact.name}}</label></strong>
<input type="checkbox" v-model="selected" :value="artifact.id" :id="artifact.id">
<strong>
<label :for="artifact.id">{{artifact.name}}</label>
</strong>
</div>
<div class="artifact-description" v-if="artifact.description">{{artifact.description}}</div>
</div>
</div>
<div
class="extra-class language-gradle selected-artifacts"
v-if="selected.length > 0"
@click="selectAll"
>
<div class="extra-class language-gradle selected-artifacts" v-if="selected.length > 0">
<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>
<br>
<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>
</template>
<script>
import {artifacts} from '../.artifacts.js';
import { artifacts } from "../.artifacts.js";
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 {
@ -42,31 +40,13 @@ export default {
data() {
return {
artifacts,
selected: ['core'],
latestVersion: 'latest_version'
selected: ["core"],
latestVersion: "latest_version"
};
},
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) {
const index = this.selected.indexOf(artifact.id)
const index = this.selected.indexOf(artifact.id);
if (index < 0) {
this.selected.push(artifact.id);
} else {
@ -119,6 +99,7 @@ export default {
margin-top: 0.5em;
}
.selected-artifact-script {
display: block;
display: flex;
flex-wrap: wrap;
}
</style>

View File

@ -70,10 +70,5 @@ module.exports = {
},
sidebarDepth: 2,
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`,
more information can be found in [HTML section](/docs/v3/core/html-renderer.md)
* [Task lists](/docs/v3/ext-tasklist/):
- [ ] Not _done_
- [X] **Done** with `X`
- [x] ~~and~~ **or** small `x`
<small><em><sup>*</sup> Task-lists are not properly displayed on this web-site, library renders them correctly</em></small>
<ul style="list-style-type: none; margin: 0; padding: 0;">
<li><input type="checkbox" disabled>Not <i>done</i></li>
<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>
</ul>
## 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",
"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": {
"version": "1.2.17",
"resolved": "https://registry.npmjs.org/math-expression-evaluator/-/math-expression-evaluator-1.2.17.tgz",

View File

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