Updated docs
This commit is contained in:
@@ -2,7 +2,12 @@ import { propsByDocsPath } from '/imports/constants/PROPERTIES.js';
|
||||
|
||||
|
||||
// Manual doc paths
|
||||
const docPaths = [];
|
||||
const docPaths = [
|
||||
'computed-fields',
|
||||
'dependency-loops',
|
||||
'docs',
|
||||
'tags',
|
||||
];
|
||||
const docs = new Map();
|
||||
docPaths.forEach(path => {
|
||||
docs.set(path, Assets.getText(`docs/${path}.md`))
|
||||
|
||||
@@ -2,13 +2,30 @@
|
||||
<v-container>
|
||||
<v-row>
|
||||
<v-col cols="12">
|
||||
<v-card>
|
||||
<v-card-text>
|
||||
<markdown-text
|
||||
:markdown="doc"
|
||||
/>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
<v-fade-transition mode="out-in">
|
||||
<v-card
|
||||
v-if="doc"
|
||||
:key="path"
|
||||
>
|
||||
<v-card-text>
|
||||
<markdown-text
|
||||
:markdown="doc"
|
||||
@click="mdClick"
|
||||
/>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
<v-progress-circular
|
||||
v-else-if="!$subReady.docs"
|
||||
indeterminate
|
||||
color="primary"
|
||||
size="32"
|
||||
/>
|
||||
<v-card v-else-if="!doc">
|
||||
<v-card-title>
|
||||
Help document not found for {{ title }}
|
||||
</v-card-title>
|
||||
</v-card>
|
||||
</v-fade-transition>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
@@ -30,11 +47,24 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
path() {
|
||||
return this.$route.params.docPath;
|
||||
return this.$route.params.docPath || 'docs';
|
||||
},
|
||||
prop() {
|
||||
return propsByDocsPath.get(this.path);
|
||||
},
|
||||
title() {
|
||||
if (this.prop) {
|
||||
return this.prop.name + ' Docs';
|
||||
} else {
|
||||
const titleCase = this.path.replace(
|
||||
/(\w*)(\W+)/g,
|
||||
function(txt, word) {
|
||||
return word.charAt(0).toUpperCase() + word.substr(1).toLowerCase() + ' ';
|
||||
}
|
||||
);
|
||||
return titleCase || 'DiceCloud Docs';
|
||||
}
|
||||
}
|
||||
},
|
||||
meteor: {
|
||||
$subscribe: {
|
||||
@@ -48,22 +78,23 @@ export default {
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
path: {
|
||||
title: {
|
||||
immediate: true,
|
||||
handler(value) {
|
||||
if (this.prop) {
|
||||
this.$store.commit('setPageTitle', this.prop.name + ' Docs');
|
||||
} else {
|
||||
const titleCase = value.replace(
|
||||
/(\w*)(\W+)/g,
|
||||
function(txt, word) {
|
||||
return word.charAt(0).toUpperCase() + word.substr(1).toLowerCase() + ' ';
|
||||
}
|
||||
);
|
||||
this.$store.commit('setPageTitle', titleCase || 'Character Sheet');
|
||||
}
|
||||
this.$store.commit('setPageTitle', value);
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
mdClick(e) {
|
||||
const target = e.target || e.srcElement;
|
||||
const href = target && target.href;
|
||||
if (!href) return;
|
||||
const path = href.split('/docs/')[1];
|
||||
if (!path) return;
|
||||
e.preventDefault();
|
||||
this.$router.push('/docs/' + path);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -251,6 +251,14 @@ RouterFactory.configure(router => {
|
||||
meta: {
|
||||
title: 'Documentation',
|
||||
},
|
||||
},{
|
||||
path: '/docs',
|
||||
components: {
|
||||
default: Documentation,
|
||||
},
|
||||
meta: {
|
||||
title: 'Documentation',
|
||||
},
|
||||
},{
|
||||
path: '/about',
|
||||
components: {
|
||||
|
||||
2
app/private/docs/dependency-loops.md
Normal file
2
app/private/docs/dependency-loops.md
Normal file
@@ -0,0 +1,2 @@
|
||||
# Dependency loops
|
||||
|
||||
38
app/private/docs/docs.md
Normal file
38
app/private/docs/docs.md
Normal file
@@ -0,0 +1,38 @@
|
||||
# DiceCloud Docs
|
||||
|
||||
## Properties
|
||||
|
||||
- ### [Action](/docs/property/action)
|
||||
- ### [Attribute](/docs/property/attribute)
|
||||
- ### [Attribute Damage](/docs/property/attribute-damage)
|
||||
- ### [Buff](/docs/property/buff)
|
||||
- ### [Remove Buff](/docs/property/remove-buff)
|
||||
- ### [Branch](/docs/property/branch)
|
||||
- ### [Class](/docs/property/class)
|
||||
- ### [Class Level](/docs/property/class-level)
|
||||
- ### [Constant](/docs/property/constant)
|
||||
- ### [Container](/docs/property/container)
|
||||
- ### [Damage](/docs/property/damage)
|
||||
- ### [Damage Multiplier](/docs/property/damage-multiplier)
|
||||
- ### [Effect](/docs/property/effect)
|
||||
- ### [Feature](/docs/property/feature)
|
||||
- ### [Item](/docs/property/item)
|
||||
- ### [Note](/docs/property/note)
|
||||
- ### [Point Buy](/docs/property/point-buy)
|
||||
- ### [Proficiency](/docs/property/proficiency)
|
||||
- ### [Roll](/docs/property/roll)
|
||||
- ### [Saving Throw](/docs/property/saving-throw)
|
||||
- ### [Skill](/docs/property/skill)
|
||||
- ### [Slot](/docs/property/slot)
|
||||
- ### [Slot Filler](/docs/property/slot-filler)
|
||||
- ### [Spell List](/docs/property/spell-list)
|
||||
- ### [Spell](/docs/property/spell)
|
||||
- ### [Toggle](/docs/property/toggle)
|
||||
- ### [Trigger](/docs/property/trigger)
|
||||
|
||||
## Topics
|
||||
|
||||
- ### [Computed fields](/docs/computed-fields)
|
||||
- ### [Inline Calculations](/docs/inline-calculations)
|
||||
- ### [Dependency Loops](/docs/dependency-loops)
|
||||
- ### [Tags](/docs/tags)
|
||||
@@ -0,0 +1,2 @@
|
||||
# Inline Calculations
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Effects
|
||||
|
||||
Effects are the core of the DiceCloud engine. Effect change the values of attributes, skills, and calculations in a way that is transparent and auditable, keeping character sheets organized and understandable, even when using intricate homebrew rules on high level characters. To understand how effects work is to understand DiceCloud characters.
|
||||
Effects are the core of the DiceCloud engine. Effect change the values of attributes, skills, and calculations in a way that is transparent and auditable, keeping character sheets organized and understandable, even when using intricate homebrew rules on high level characters.
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
# Tags
|
||||
|
||||
|
||||
Reference in New Issue
Block a user