Skip to content

Commit

Permalink
improvement(cli): show path of src file
Browse files Browse the repository at this point in the history
update dependencies
remove some example code
  • Loading branch information
ph1p committed Aug 15, 2019
1 parent 73fd9f4 commit 7f628ff
Show file tree
Hide file tree
Showing 9 changed files with 1,617 additions and 1,870 deletions.
4 changes: 2 additions & 2 deletions cmds/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,15 @@ async function generate(argv) {

console.log(
chalk.black.bgRed(isConfigExclude ? 'exclude by config' : 'error'),
`${folderPath}/${fileName}.md`
`${folder}/${file} -> ${folderPath}/${fileName}.md`
);
}
}

if (mdFileData) {
const { frontmatter, attributes } = parseVuepressComment(fileData);

console.log(chalk.black.bgGreen('write file'), `${folderPath}/${fileName}.md`);
console.log(chalk.black.bgGreen('write file'), `${folder}/${file} -> ${folderPath}/${fileName}.md`);

let fileContent = '---\n';

Expand Down
31 changes: 31 additions & 0 deletions example/documentation/code/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
exports.fileTree = [
{ name: 'class', path: '/class', fullPath: './documentation/code/class' },
{
name: 'lib',
children: [
{ name: 'dmd-options', path: '/dmd-options', fullPath: 'lib/dmd-options' },
{ name: 'jsdoc-to-markdown', path: '/jsdoc-to-markdown', fullPath: 'lib/jsdoc-to-markdown' }
]
},
{ name: 'methods', path: '/methods', fullPath: './documentation/code/methods' },
{ name: 'objects', path: '/objects', fullPath: './documentation/code/objects' },
{
name: 'subfolder',
children: [
{
name: 'subfolder.1',
children: [{ name: 'variables', path: '/variables', fullPath: 'subfolder/subfolder.1/variables' }]
},
{ name: 'variables', path: '/variables', fullPath: 'subfolder/variables' }
]
},
{ name: 'test', path: '/test', fullPath: './documentation/code/test' },
{ name: 'tests', children: [] }
];
exports.sidebarTree = (title = 'Mainpage') => ({
'/code/': [
{ title: 'API', collapsable: false, children: [['', '' + title + ''], 'class', 'methods', 'objects', 'test'] },
{ title: 'lib', collapsable: false, children: ['lib/dmd-options', 'lib/jsdoc-to-markdown'] },
{ title: 'subfolder', collapsable: false, children: ['subfolder/subfolder.1/variables', 'subfolder/variables'] }
]
});
42 changes: 42 additions & 0 deletions example/documentation/code/objects.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
title: objects
---

# objects

<a name="obj"></a>

## obj
Object description

**Kind**: global constant

* [obj](#obj)
* [.name](#obj.name)
* [.objMethod(parameter)](#obj.objMethod)
* [.objMethodTwo()](#obj.objMethodTwo)

<a name="obj.name"></a>

### obj.name
name

**Kind**: static property of [<code>obj</code>](#obj)
<a name="obj.objMethod"></a>

### obj.objMethod(parameter) ⇒
A function with a parameter and returns the name

**Kind**: static method of [<code>obj</code>](#obj)
**Returns**: this.name

| Param | Type |
| --- | --- |
| parameter | <code>any</code> |

<a name="obj.objMethodTwo"></a>

### obj.objMethodTwo()
Old way to write methods in objects

**Kind**: static method of [<code>obj</code>](#obj)
34 changes: 34 additions & 0 deletions example/documentation/code/subfolder/subfolder.1/variables.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: variables
---

# variables

## Members

<dl>
<dt><a href="#normalLetVariable">normalLetVariable</a></dt>
<dd><p>A normal let variable</p>
</dd>
</dl>

## Constants

<dl>
<dt><a href="#MY_CONST_VAR">MY_CONST_VAR</a></dt>
<dd><p>Symbol constant</p>
</dd>
</dl>

<a name="normalLetVariable"></a>

## normalLetVariable
A normal let variable

**Kind**: global variable
<a name="MY_CONST_VAR"></a>

## MY\_CONST\_VAR
Symbol constant

**Kind**: global constant
34 changes: 34 additions & 0 deletions example/documentation/code/subfolder/variables.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: variables
---

# variables

## Members

<dl>
<dt><a href="#normalLetVariable">normalLetVariable</a></dt>
<dd><p>A normal let variable</p>
</dd>
</dl>

## Constants

<dl>
<dt><a href="#SUBFOLDER">SUBFOLDER</a></dt>
<dd><p>A constant</p>
</dd>
</dl>

<a name="normalLetVariable"></a>

## normalLetVariable
A normal let variable

**Kind**: global variable
<a name="SUBFOLDER"></a>

## SUBFOLDER
A constant

**Kind**: global constant
26 changes: 26 additions & 0 deletions example/documentation/code/test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
title: test
---
# test

## data

- `num`

**initial value:** `100`

## computed properties

- `testComputed`

**dependencies:** `num`


## methods

- `getNumber(num)`

**parameters:**

- `num` **number** -

128 changes: 9 additions & 119 deletions example/src/test.vue
Original file line number Diff line number Diff line change
@@ -1,139 +1,29 @@
<template>
<div class="navigation">

</div>
<div class="navigation"></div>
</template>

<script>
import EndNavigationModal from './EndNavigationModal';
import { Carousel, Slide } from 'vue-carousel';
/**
* @vue
*/
export default {
components: {
EndNavigationModal,
Carousel,
Slide
},
data() {
return {
isNavigationLocked: false
num: 100
};
},
computed: {
isNavigationVisible() {
return this.$store.getters.isNavigationVisible;
},
isEndNavigationModalVisible() {
return this.$store.getters.isEndNavigationModalVisible;
},
activeSection() {
return this.$store.getters.activeSection;
},
activeSubSection() {
return this.$store.getters.activeSubSection;
},
sections() {
return this.$sections;
},
sectionsWithoutProfiSubviews() {
return this.$sectionsWithoutProfiSubviews;
testComputed() {
return this.num * 5;
}
},
methods: {
formatSubViewNumber(index) {
return index < 9 ? `0${index + 1}` : index + 1;
},
calcProgressbarWidth() {
const activeSectionWidth = this.sectionsWithoutProfiSubviews[this.activeSection].subviews.length;
let barWidth = 18;
if (activeSectionWidth < 10) {
barWidth = 40;
} else if (activeSectionWidth < 15) {
barWidth = 30;
}
return barWidth;
},
resetActiveSubsection() {
this.$store.dispatch(
'setActiveSubSection',
this.sectionsWithoutProfiSubviews[this.activeSection].subviews[0].meta.index
);
},
resetNavigation() {
this.toggleCloseNavigationModal();
this.toggleNav();
this.$router.push({
path: '/'
});
},
toggleNav() {
if (!this.isNavigationLocked) {
this.$store.dispatch('toggleIsNavigationVisible');
}
},
toggleCloseNavigationModal() {
if (!this.isNavigationLocked) {
this.$store.dispatch('toggleIsEndNavigationModalVisible');
}
},
/**
* @param {Number} index Number of the section to display
*/
setActiveSection(index) {
this.$store.dispatch('setActiveSection', index);
this.$store.dispatch('setActiveSubSection', 0);
},
/**
* @param {Number} index Number of the subsection to display
*/
setActiveSubSection(index) {
this.$store.dispatch('setActiveSubSection', index);
},
/**
* Navigate to the next subsection
*/
nextSubsection() {
if (!this.isNavigationLocked) {
if (this.activeSubSection < this.$sections[this.activeSection].subviews.length - 1) {
this.$store.dispatch('setActiveSubSection', this.activeSubSection + 1);
this.$router.push({
path: `/${this.sections[this.activeSection].path}/${
this.sections[this.activeSection].subviews[this.activeSubSection].path
}`
});
} else {
this.$router.push({
path: '/pyramid'
});
}
}
},
/**
* Navigate to the prevoius subsection
* @param {number} num -
*/
previousSubsection() {
if (!this.isNavigationLocked) {
if (this.activeSubSection > 0) {
this.$store.dispatch('setActiveSubSection', this.activeSubSection - 1);
this.$router.push({
path: `/${this.sections[this.activeSection].path}/${
this.sections[this.activeSection].subviews[this.activeSubSection].path
}`
});
}
}
getNumber(num) {
return num;
}
},
created() {
this.$root.$on('toggle-paintable-screen', isPainterActive => {
this.isNavigationLocked = isPainterActive;
});
}
created() {}
};
</script>

<style lang="scss" scoped>
</style>
<style lang="scss" scoped></style>
Loading

0 comments on commit 7f628ff

Please sign in to comment.