Skip to content

Commit

Permalink
Introduce scaffdog (#10)
Browse files Browse the repository at this point in the history
* feat: add new command to create scaffold by scaffdog

* doc: write documentation for 'npm run new'

* chore: add newline in the end of file
  • Loading branch information
kaakaa committed Dec 6, 2023
1 parent bc9e2c2 commit caa27b0
Show file tree
Hide file tree
Showing 5 changed files with 2,423 additions and 18 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ jobs:
* [GitHub Releases(PDF)](https://github.com/${{ github.repository }}/releases)
## Write and deploy a slide
1. Create a directory (e.g.: \`my-slide\`)
2. Create \`slides.md\` in the directory and write slidev to the file (e.g.:\`my-slide/slides.md\`)
* The file name must be \`slides.md\` because it's hardcoded in [\`package.json\`](./package.json)
1. Run `npm run new` and specify a name of directory (e.g.:\`my-slide/slides.md\`) to create new sub-project (including the following steps)
* Create a directory (e.g.: \`my-slide\`)
* Create \`slides.md\` in the directory and write slidev to the file (e.g.:\`my-slide/slides.md\`)
* The file name must be \`slides.md\` because it's hardcoded in [\`package.json\`](./package.json)
3. (Optional) Create a sub directory for slidev's assets if you want use it in the slide (e.g.:\`my-slide/public\`, \`my-slide/components\`)
4. Commit it and create a tag with the name of the directory (e.g.: \`my-slide\`)
Expand Down
3 changes: 3 additions & 0 deletions .scaffdog/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
files: ['*'],
};
56 changes: 56 additions & 0 deletions .scaffdog/new_slide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
name: 'new_slide'
root: '.'
output: '.'
questions:
name: 'Please enter a name of directory for slide:'
---

# `{{ inputs.name }}`/slides.md

```md
---
theme: seriph
background: https://source.unsplash.com/collection/94734566/1920x1080
class: text-center
highlighter: shiki
info: |
## {{ inputs.name }}
Presentation slides for {{ inputs.name }}.
transition: slide-left
title: {{ inputs.name }}
mdc: true
githubPages:
ogp: true
---

# Welcome to Slidev

Presentation slides for developers

<div class="pt-12">
<span @click="$slidev.nav.next" class="px-2 py-1 rounded cursor-pointer" hover="bg-white bg-opacity-10">
Press Space for next page <carbon:arrow-right class="inline"/>
</span>
</div>

<div class="abs-br m-6 flex gap-2">
<button @click="$slidev.nav.openInEditor()" title="Open in Editor" class="text-xl slidev-icon-btn opacity-50 !border-none !hover:text-white">
<carbon:edit />
</button>
<a href="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/slidevjs/slidev" target="_blank" alt="GitHub" title="Open in GitHub"
class="text-xl slidev-icon-btn opacity-50 !border-none !hover:text-white">
<carbon-logo-github />
</a>
</div>

<!--
The last comment block of each slide will be treated as slide notes. It will be visible and editable in Presenter Mode along with the slide. [Read more in the docs](https://sli.dev/guide/syntax.html#notes)
-->
```


# `{{ inputs.name }}`/public/.gitkeep

```
```
Loading

0 comments on commit caa27b0

Please sign in to comment.