diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 3d167e5..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,82 +0,0 @@ -version: 2.1 - -executors: - node: - parameters: - version: - type: string - default: lts - docker: - - image: circleci/node:<< parameters.version >> - working_directory: ~/marp - -commands: - install: - parameters: - postinstall: - type: steps - default: [] - yarn: - type: string - default: 1.22.4 - steps: - - run: - name: Upgrade yarn for current user - command: cd ~ && yarn policies set-version << parameters.yarn >> - - - restore_cache: - keys: - - v2.2-dependencies-{{ .Environment.CIRCLE_JOB }}-{{ checksum "yarn.lock" }}-{{ .Branch }} - - v2.2-dependencies-{{ .Environment.CIRCLE_JOB }}-{{ checksum "yarn.lock" }}- - - v2.2-dependencies-{{ .Environment.CIRCLE_JOB }}- - - - run: yarn install - - steps: << parameters.postinstall >> - - - save_cache: - key: v2.2-dependencies-{{ .Environment.CIRCLE_JOB }}-{{ checksum "yarn.lock" }}-{{ .Branch }} - paths: - - ~/.cache/yarn - - audit: - steps: - - checkout - - install: - postinstall: - - run: yarn audit - - test: - steps: - - run: node --version - - - checkout - - install - - - run: - name: Prettier formatting - command: yarn check:format - - - run: - name: ESLint - command: yarn lint - -jobs: - audit: - executor: node - steps: - - audit - - test-node: - executor: - name: node - version: '12.16.3' # Specify LTS version for development - steps: - - test - -workflows: - test: - jobs: - - audit - - test-node: - requires: - - audit diff --git a/.eslintignore b/.eslintignore index 287b80d..df67a9f 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,4 +1,5 @@ -.cache/ -dist +.next +coverage +lib node_modules -tmp +out diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..3e3c73d --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,40 @@ +const path = require('path') +const { workspaces } = require('./package.json') + +module.exports = { + root: true, + env: { + browser: true, + node: true, + }, + extends: ['eslint:recommended', 'plugin:import/recommended', 'prettier'], + rules: { + 'import/order': ['error', { alphabetize: { order: 'asc' } }], + }, + overrides: [ + { + files: ['**/*.ts', '**/*.tsx'], + parser: '@typescript-eslint/parser', + plugins: ['@typescript-eslint'], + extends: [ + 'plugin:@typescript-eslint/recommended', + 'plugin:import/typescript', + 'prettier/@typescript-eslint', + ], + rules: { + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/explicit-function-return-type': 'off', + '@typescript-eslint/explicit-module-boundary-types': 'off', + }, + settings: { + 'import/resolver': { + typescript: { + project: ['', ...workspaces].map((dir) => + path.join(dir, 'tsconfig.json') + ), + }, + }, + }, + }, + ], +} diff --git a/.eslintrc.yml b/.eslintrc.yml deleted file mode 100644 index 7f98a81..0000000 --- a/.eslintrc.yml +++ /dev/null @@ -1,29 +0,0 @@ -env: - browser: true - es6: true - node: true - -extends: - - eslint:recommended - - plugin:import/recommended - - plugin:import/react - - plugin:react/recommended - - prettier - - prettier/react - -root: true - -settings: - import/resolver: - node: - extensions: - - .js - - .jsx - react: - version: detect - -rules: - import/order: - - error - - alphabetize: - order: asc diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..f399028 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,21 @@ +version: 2 + +updates: + - package-ecosystem: npm + directory: '/' + reviewers: + - 'marp-team/maintainers' + schedule: + interval: daily + allow: + - dependency-name: '@marp-team/*' + versioning-strategy: increase + + - package-ecosystem: github-actions + directory: '/' + reviewers: + - 'marp-team/maintainers' + schedule: + interval: weekly + # versioning-strategy: increase-if-necessary + open-pull-requests-limit: 0 # Dependabot does not allow relaxed versioning :( diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..58445a6 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,54 @@ +name: Test + +on: + - pull_request + - push + +env: + CACHE_PREFIX: v1 + YARN_VERSION: '^1.22.4' + +jobs: + validate: + runs-on: ubuntu-latest + if: ${{ github.ref == 'refs/heads/master' || !startsWith(github.event.head_commit.message, '[ci skip]') }} + steps: + - run: echo "${{ github.event.head_commit.message }}" + + test: + runs-on: ubuntu-latest + needs: validate + steps: + - uses: actions/checkout@v2 + + - name: Detect Node version from .nvmrc + id: node_version + run: echo "::set-output name=nvmrc::$(cat .nvmrc)" + + - uses: actions/setup-node@v2-beta + with: + node-version: ${{ steps.node_version.outputs.nvmrc }} + + - name: Install yarn + id: yarn + run: | + cd $HOME && yarn policies set-version $YARN_VERSION + echo "::set-output name=cache_dir::$(yarn cache dir)" + + - uses: actions/cache@v2 + with: + path: ${{ steps.yarn.outputs.cache_dir }} + key: yarn_cache-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/yarn.lock') }} + restore-keys: yarn_cache-${{ env.CACHE_PREFIX }}- + + - run: yarn install + - run: yarn audit + + - name: Prettier formatting + run: yarn check:format + + - name: ESLint + run: yarn lint:js + + - name: TypeScript type checking + run: yarn check:ts diff --git a/.gitignore b/.gitignore index ddbe296..3f10576 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ -tmp +out -# Created by https://www.gitignore.io/api/node,windows,macos,linux,sublimetext,emacs,vim,visualstudiocode +# Created by https://www.toptal.com/developers/gitignore/api/node,windows,macos,linux,sublimetext,emacs,vim,visualstudiocode +# Edit at https://www.toptal.com/developers/gitignore?templates=node,windows,macos,linux,sublimetext,emacs,vim,visualstudiocode ### Emacs ### # -*- mode: gitignore; -*- @@ -49,6 +50,10 @@ flycheck_*.el # directory configuration .dir-locals.el +# network security +/network-security.data + + ### Linux ### # temporary files which can be created if a process still has a handle open of a deleted file @@ -98,6 +103,10 @@ logs npm-debug.log* yarn-debug.log* yarn-error.log* +lerna-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json # Runtime data pids @@ -110,11 +119,12 @@ lib-cov # Coverage directory used by tools like istanbul coverage +*.lcov # nyc test coverage .nyc_output -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) .grunt # Bower dependency directory (https://bower.io/) @@ -133,12 +143,21 @@ jspm_packages/ # TypeScript v1 declaration files typings/ +# TypeScript cache +*.tsbuildinfo + # Optional npm cache directory .npm # Optional eslint cache .eslintcache +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + # Optional REPL history .node_repl_history @@ -150,21 +169,41 @@ typings/ # dotenv environment variables file .env +.env.test # parcel-bundler cache (https://parceljs.org/) .cache -# next.js build output +# Next.js build output .next -# nuxt.js build output +# Nuxt.js build / generate output .nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and not Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public # vuepress build output .vuepress/dist # Serverless directories -.serverless +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# Stores VSCode versions used for testing VSCode extensions +.vscode-test ### SublimeText ### # Cache files for Sublime Text @@ -201,6 +240,7 @@ GitHub.sublime-settings ### Vim ### # Swap [._]*.s[a-v][a-z] +!*.svg # comment out if you don't need vector files [._]*.sw[a-p] [._]s[a-rt-v][a-z] [._]ss[a-gi-z] @@ -208,6 +248,7 @@ GitHub.sublime-settings # Session Session.vim +Sessionx.vim # Temporary .netrwhist @@ -218,14 +259,16 @@ tags ### VisualStudioCode ### .vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json +*.code-workspace + +### VisualStudioCode Patch ### +# Ignore all local history of files +.history ### Windows ### # Windows thumbnail cache files Thumbs.db +Thumbs.db:encryptable ehthumbs.db ehthumbs_vista.db @@ -248,5 +291,4 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk - -# End of https://www.gitignore.io/api/node,windows,macos,linux,sublimetext,emacs,vim,visualstudiocode +# End of https://www.toptal.com/developers/gitignore/api/node,windows,macos,linux,sublimetext,emacs,vim,visualstudiocode diff --git a/.nvmrc b/.nvmrc index 493319d..9cd25a1 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -12.16.3 +12.18.3 diff --git a/.prettierignore b/.prettierignore index 3123403..65eb68d 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,6 +1,3 @@ -.git/ -.cache/ -.vscode/ -dist +.next node_modules -tmp +out diff --git a/LICENSE b/LICENSE index 50ecfa9..2b42791 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018- Marp team (marp-team@marp.app) +Copyright (c) 2018-2020 Marp team (marp-team@marp.app) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 63bf687..004d86b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@

- Marp + Marp

Marp: Markdown Presentation Ecosystem @@ -9,34 +9,63 @@ **Marp** is the ecosystem to write your presentation with plain Markdown. +

+ +### [Go to the official website ▶︎](https://marp.app) + +
+ ## Marp family -Our project is spread over many repos in order to focus on a limited scope per repository. Active projects are shown as emphasized in following list. +Our project is spread over many repos in order to focus on a limited scope per repository. -This repo (**[@marp-team/marp][marp]**) is an entrance to the Marp family, and places [our website](https://marp.app/). +This repo (**[marp-team/marp][marp]**) is an entrance to the Marp family, and places [our website](https://marp.app/) in `/website`. ### Framework / Core -| Name | Description | Release | -| -------------------------: | :--------------------------------------------------------------------------------- | :-------------------------------------------------------- | -| **[Marpit]** | The skinny framework for creating slide deck from Markdown. ([marpit.marp.app]) | [![@marp-team/marpit][badge-marpit]][marpit-npm] | -| **[Marp Core][marp-core]** | The core of Marp converter with practical features and [themes][marp-core-themes]. | [![@marp-team/marp-core][badge-marp-core]][marp-core-npm] | +| Name | Description | Release | +| -------------------------: | :------------------------------------------------------------------------------------------ | :-------------------------------------------------------- | +| **[Marpit]** | The skinny framework for creating slide deck from Markdown. ([marpit.marp.app]) | [![@marp-team/marpit][badge-marpit]][marpit-npm] | +| **[Marp Core][marp-core]** | The core of Marp converter with practical features and [built-in themes][marp-core-themes]. | [![@marp-team/marp-core][badge-marp-core]][marp-core-npm] | ### Apps | Name | Description | Release | | -----------------------: | :----------------------------------------------------------------------------------------------- | :----------------------------------------------------- | | **[Marp CLI][marp-cli]** | [Marp Core][marp-core] / [Marpit]'s CLI interface to convert into HTML, PDF, PPTX, and image(s). | [![@marp-team/marp-cli][badge-marp-cli]][marp-cli-npm] | -| [Marp Web][marp-web] | The main interface of Marp based on [PWA] and [Preact] framework. | [![tech demo][badge-marp-web]][marp-web-site] | -| Marp Desktop | The desktop client for [Marp Web][marp-web-site] for replacing [yhatt/marp]. | ![PLANNED][badge-planned] | ### Integrations -| Name | Description | Release | -| -----------------------------: | :-------------------------------------------------------------------------------- | :----------------------------------------------------------- | -| **[Marp VSCode][marp-vscode]** | A [VS Code][vscode] extension to preview the slide deck written in Marp Markdown. | [![VS Marketplace][badge-marp-vscode]][marp-vscode-release] | -| [Marp React][marp-react] | Marp renderer component for [React]. | [![@marp-team/marp-react][badge-marp-react]][marp-react-npm] | -| [Marp Vue][marp-vue] | Marp renderer component for [Vue]. | [![@marp-team/marp-vue][badge-marp-vue]][marp-vue-npm] | +| Name | Description | Release | +| ----------------------------------: | :-------------------------------------------------------------------------------- | :---------------------------------------------------------- | +| **[Marp for VS Code][marp-vscode]** | A [VS Code][vscode] extension to preview the slide deck written in Marp Markdown. | [![VS Marketplace][badge-marp-vscode]][marp-vscode-release] | + +
+See outdated/inactive projects...
+ +| Name | Description | Release | +| -----------------------: | :--------------------------------------------------------------- | :----------------------------------------------------------- | +| [Marp Web][marp-web] | The Web interface of Marp based on [PWA] and [Preact] framework. | [![tech demo][badge-marp-web]][marp-web-site] | +| [Marp React][marp-react] | Marp renderer component for [React]. | [![@marp-team/marp-react][badge-marp-react]][marp-react-npm] | +| [Marp Vue][marp-vue] | Marp renderer component for [Vue]. | [![@marp-team/marp-vue][badge-marp-vue]][marp-vue-npm] | + +And there is a gravesite of classic Marp app in https://github.com/yhatt/marp. :ghost: + +[marp-web]: https://github.com/marp-team/marp-web +[marp-react]: https://github.com/marp-team/marp-react +[marp-vue]: https://github.com/marp-team/marp-vue +[pwa]: https://en.wikipedia.org/wiki/Progressive_Web_Apps +[preact]: https://preactjs.com/ +[react]: https://reactjs.org/ +[vue]: https://vuejs.org/ +[marp-web-site]: https://web.marp.app/ +[marp-react-npm]: https://www.npmjs.com/package/@marp-team/marp-react +[marp-vue-npm]: https://www.npmjs.com/package/@marp-team/marp-vue +[badge-marp-web]: https://img.shields.io/badge/%E2%80%8B-tech%20demo-%230288d1.svg?style=flat-square&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAUUlEQVQokWNgGD6AqePif3Sx9B2PMcQwNKFrTN/x+D9ejTBNyBphmnBqRNYE04isCatGdE1MHRf/o2vC0IhNE1PaXPwacWnCqxGfJoI2Dn4AAN0ZrMM1VUFvAAAAAElFTkSuQmCC +[badge-marp-react]: https://img.shields.io/npm/v/@marp-team/marp-react.svg?style=flat-square&logo=npm +[badge-marp-vue]: https://img.shields.io/npm/v/@marp-team/marp-vue.svg?style=flat-square&logo=npm + +
[yhatt/marp]: https://github.com/yhatt/marp [marp]: https://github.com/marp-team/marp @@ -44,37 +73,21 @@ This repo (**[@marp-team/marp][marp]**) is an entrance to the Marp family, and p [marp-core]: https://github.com/marp-team/marp-core [marp-core-themes]: https://github.com/marp-team/marp-core/tree/master/themes [marp-cli]: https://github.com/marp-team/marp-cli -[marp-web]: https://github.com/marp-team/marp-web [marp-vscode]: https://github.com/marp-team/marp-vscode -[marp-react]: https://github.com/marp-team/marp-react -[marp-vue]: https://github.com/marp-team/marp-vue -[pwa]: https://en.wikipedia.org/wiki/Progressive_Web_Apps -[preact]: https://preactjs.com/ -[electron]: https://electronjs.org/ [vscode]: https://code.visualstudio.com/ -[react]: https://reactjs.org/ -[vue]: https://vuejs.org/ [marpit.marp.app]: https://marpit.marp.app/ [marpit-npm]: https://www.npmjs.com/package/@marp-team/marpit [marp-core-npm]: https://www.npmjs.com/package/@marp-team/marp-core [marp-cli-npm]: https://www.npmjs.com/package/@marp-team/marp-cli -[marp-web-site]: https://web.marp.app/ [marp-vscode-release]: https://marketplace.visualstudio.com/items?itemName=marp-team.marp-vscode -[marp-react-npm]: https://www.npmjs.com/package/@marp-team/marp-react -[marp-vue-npm]: https://www.npmjs.com/package/@marp-team/marp-vue [badge-marpit]: https://img.shields.io/npm/v/@marp-team/marpit.svg?style=flat-square&logo=npm [badge-marp-core]: https://img.shields.io/npm/v/@marp-team/marp-core.svg?style=flat-square&logo=npm [badge-marp-cli]: https://img.shields.io/npm/v/@marp-team/marp-cli.svg?style=flat-square&logo=npm -[badge-marp-web]: https://img.shields.io/badge/%E2%80%8B-tech%20demo-%230288d1.svg?style=flat-square&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAUUlEQVQokWNgGD6AqePif3Sx9B2PMcQwNKFrTN/x+D9ejTBNyBphmnBqRNYE04isCatGdE1MHRf/o2vC0IhNE1PaXPwacWnCqxGfJoI2Dn4AAN0ZrMM1VUFvAAAAAElFTkSuQmCC [badge-marp-vscode]: https://img.shields.io/visual-studio-marketplace/v/marp-team.marp-vscode.svg?style=flat-square&logo=visual-studio-code&label=Marketplace -[badge-marp-react]: https://img.shields.io/npm/v/@marp-team/marp-react.svg?style=flat-square&logo=npm -[badge-marp-vue]: https://img.shields.io/npm/v/@marp-team/marp-vue.svg?style=flat-square&logo=npm -[badge-planned]: https://img.shields.io/badge/-PLANNED-lightgrey.svg?style=flat-square -[badge-wip]: https://img.shields.io/badge/-Work%20in%20progress-lightgrey.svg?style=flat-square ## Examples -### Starter +### Starter by Marp author - **[Marp CLI example](https://yhatt-marp-cli-example.netlify.com/)** by [@yhatt](https://github.com/yhatt) - A good starter to write and host Marp slide with [GitPitch](https://gitpitch.com/) style powered by [Netlify](https://www.netlify.com/). (https://github.com/yhatt/marp-cli-example) @@ -88,8 +101,6 @@ This repo (**[@marp-team/marp][marp]**) is an entrance to the Marp family, and p Let us know if you have created an awesome slide deck with Marp ecosystem! [Edit README.md and send pull request.](https://github.com/marp-team/marp/edit/master/README.md) - - ## Contributing Marp and sub-projects are following the [contributing guideline of marp-team][contributing]. Please read this before starting work in our projects. diff --git a/lerna.json b/lerna.json index b30fe46..156f8dd 100644 --- a/lerna.json +++ b/lerna.json @@ -1,6 +1,6 @@ { "version": "0.0.0", - "packages": ["packages/*"], + "packages": ["packages/*", "website"], "npmClient": "yarn", "useWorkspaces": true } diff --git a/marp.png b/marp.png index 6991e3f..8c7079e 100644 Binary files a/marp.png and b/marp.png differ diff --git a/netlify.toml b/netlify.toml index 8b9630e..ab6a704 100644 --- a/netlify.toml +++ b/netlify.toml @@ -1,3 +1,3 @@ [build] - publish = "packages/website/dist" - command = "yarn workspace @marp-team/marp-website build" + publish = "website/out" + command = "yarn workspace @marp-team/marp-website export" diff --git a/package.json b/package.json index a4afe0d..e95ae24 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@marp-team/marp", - "description": "The entrance repository of Marp family", + "description": "The entrance repository of Markdown presentation ecosystem", "private": true, "license": "MIT", "author": { @@ -18,7 +18,8 @@ "url": "https://github.com/marp-team/marp" }, "workspaces": [ - "packages/*" + "packages/*", + "website" ], "prettier": { "semi": false, @@ -26,16 +27,23 @@ }, "scripts": { "check:format": "yarn -s format -c", - "format": "prettier \"**/*.{css,html,js,json,jsx,md,scss,yaml,yml}\"", - "lint": "eslint \"**/*.{js,jsx}\"", - "website": "yarn -s workspace @marp-team/marp-website serve" + "check:ts": "lerna run --parallel check:ts", + "format:write": "yarn -s format --write", + "format": "prettier \"**/*.{css,js,jsx,json,md,mdx,scss,ts,tsx,yaml,yml}\"", + "lint:js": "eslint --ext .js,.jsx,.ts,.tsx --report-unused-disable-directives --cache .", + "website": "yarn workspace @marp-team/marp-website dev" }, "devDependencies": { - "eslint": "^7.0.0", + "@tsconfig/recommended": "^1.0.1", + "@types/node": "^12.12.54", + "@typescript-eslint/eslint-plugin": "^3.9.1", + "@typescript-eslint/parser": "^3.9.1", + "eslint": "^7.7.0", "eslint-config-prettier": "^6.11.0", - "eslint-plugin-import": "^2.20.2", - "eslint-plugin-react": "^7.20.0", - "lerna": "^3.21.0", - "prettier": "^2.0.5" + "eslint-import-resolver-typescript": "^2.2.1", + "eslint-plugin-import": "^2.22.0", + "lerna": "^3.22.1", + "prettier": "^2.0.5", + "typescript": "^4.0.2" } } diff --git a/packages/website/.eslintrc.yml b/packages/website/.eslintrc.yml deleted file mode 100644 index ef97335..0000000 --- a/packages/website/.eslintrc.yml +++ /dev/null @@ -1,6 +0,0 @@ -rules: - react/prop-types: 0 - react/react-in-jsx-scope: 0 # Charge does not require to import React - import/extensions: # Charge cannot resolve dependency correctly if omitted extension - - error - - always diff --git a/packages/website/package.json b/packages/website/package.json deleted file mode 100644 index 2d62396..0000000 --- a/packages/website/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "@marp-team/marp-website", - "version": "0.0.0", - "private": true, - "license": "MIT", - "author": { - "name": "Marp team", - "url": "https://github.com/marp-team" - }, - "repository": { - "type": "git", - "url": "https://github.com/marp-team/marp" - }, - "scripts": { - "build": "cross-env NODE_ENV=production charge build src dist", - "serve": "cross-env NODE_ENV=development charge serve src" - }, - "devDependencies": { - "@emotion/core": "^10.0.28", - "@marp-team/marp-core": "^1.1.0", - "@static/charge": "^1.7.0", - "cross-env": "^7.0.2", - "github-slugger": "^1.3.0", - "highlight.js": "^10.0.3", - "react-innertext": "^1.1.5" - } -} diff --git a/packages/website/src/apple-touch-icon-180x180.png b/packages/website/src/apple-touch-icon-180x180.png deleted file mode 100644 index 634b654..0000000 Binary files a/packages/website/src/apple-touch-icon-180x180.png and /dev/null differ diff --git a/packages/website/src/assets/marp-cli.png b/packages/website/src/assets/marp-cli.png deleted file mode 100644 index 1fe5b1a..0000000 Binary files a/packages/website/src/assets/marp-cli.png and /dev/null differ diff --git a/packages/website/src/assets/marp-for-vs-code.png b/packages/website/src/assets/marp-for-vs-code.png deleted file mode 100644 index 332db42..0000000 Binary files a/packages/website/src/assets/marp-for-vs-code.png and /dev/null differ diff --git a/packages/website/src/blog.html.jsx b/packages/website/src/blog.html.jsx deleted file mode 100644 index e231b3a..0000000 --- a/packages/website/src/blog.html.jsx +++ /dev/null @@ -1,97 +0,0 @@ -/** @jsx jsx */ -import { jsx, css } from '@emotion/core' -import { Meta, blogStyle } from './blog.jsx' -import { Heading } from './components/heading.js.jsx' -import { Layout, contentStyle, generateTitle } from './layout.jsx' - -export default function Blog({ environment, pages }) { - const articles = pages - .filter((p) => p.path.startsWith('/blog/') && p.meta.title && p.meta.date) - .sort((a, b) => new Date(b.meta.date) - new Date(a.meta.date)) - - return ( - -
- - Blog - - {articles.map((article) => ( -
- - {article.meta.title} - -
- -

{article.meta.title}

-
- - {article.meta.description && ( -
-

{article.meta.description}

-
- )} -
-
- ))} -
-
- ) -} diff --git a/packages/website/src/blog.jsx b/packages/website/src/blog.jsx deleted file mode 100644 index 62050ec..0000000 --- a/packages/website/src/blog.jsx +++ /dev/null @@ -1,276 +0,0 @@ -/** @jsx jsx */ -import { jsx, css } from '@emotion/core' -import { MDXProvider } from '@mdx-js/react' -import GitHubSlugger from 'github-slugger' -import { Heading } from './components/blog/heading.js.jsx' -import { Layout, contentStyle, generateTitle, resolvePath } from './layout.jsx' - -const articleStyle = css` - margin: 10px auto; - - h1 { - margin: 0 0 0.5em 0; - } -` -const coverStyle = css` - box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); - display: block; - height: auto; - margin: 1em auto; - max-height: 320px; - max-width: 640px; - object-fit: cover; - width: 100%; -` - -export const blogStyle = ({ fontSize = 17 } = {}) => css` - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, - Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif, - Apple Color Emoji, Segoe UI Emoji; - font-size: ${fontSize}px; - letter-spacing: 0.03em; - line-height: 1.5; - margin: 2em 0; - white-space: break-word; - - p { - margin: ${fontSize}px 0; - } - - h1, - h2, - h3, - h4, - h5, - h6 { - margin: ${fontSize * 2}px 0 ${fontSize}px 0; - font-weight: bold; - } - - h1 { - background: transparent - linear-gradient(to bottom, transparent 85%, #67b8e3 85%); - font-size: 1.6em; - max-width: 100%; - width: max-content; - } - - h2 { - font-size: 1.3em; - } - - h3 { - font-size: 1.1em; - } - - h4 { - font-size: 1em; - } - - h5 { - font-size: 0.9em; - } - - h6 { - color: #666; - font-size: 0.8em; - } - - img { - border-style: none; - max-width: 100%; - } - - figure { - img { - display: block; - margin: 1em auto; - } - } - - hr { - background: linear-gradient(-45deg, #eee 33%, #ccc 33%, #ccc 67%, #eee 67%) - repeat center center; - background-size: 6px 3px; - border: none; - height: 3px; - margin: ${fontSize * 2}px 0; - } - - ul, - ol, - pre, - blockquote { - margin: ${fontSize * 1.5}px 0; - } - - ul, - ol { - padding: 0 0 0 1.75em; - - li { - margin: ${fontSize * 0.25}px 0; - } - - ul, - ol { - margin: ${fontSize * 0.25}px 0; - } - } - - code, - pre { - font-family: 'Source Code Pro', 'Courier New', Courier, monospace; - background-color: #f6f6f6; - border-radius: 2px; - letter-spacing: 0; - } - - code { - font-size: 0.85em; - margin: 0; - padding: 0.15em 0.35em; - } - - pre { - background-image: url('/assets/noise.png'); - box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15); - box-sizing: border-box; - font-weight: 500; - line-height: 1.1em; - overflow-x: auto; - white-space: pre; - word-wrap: normal; - - > code { - background-color: transparent; - border-radius: 0; - box-shadow: none; - display: inline-block; - margin: 1em; - padding: 0; - } - } - - blockquote { - border-left: 3px solid #007aad; - color: #666; - padding: 0 0 0 1em; - - blockquote { - border-color: #009bda; - - blockquote { - border-color: #78c5e9; - - blockquote { - border-color: #ccc; - } - } - } - } -` - -export const Meta = ({ author, date, github }) => ( -
a { - align-items: center; - display: flex; - flex-wrap: wrap; - } - - img { - width: 2em; - height: 2em; - border-radius: 2em; - } - `} - > - - {author && ( - <> -  by  - {(() => { - if (!github) return author - - return ( - - {author} -  {author} - - ) - })()} - - )} -
-) - -export const BlogLayout = ({ children, meta }) => { - const { - title, - description, - image, - imageCaption, - slug, - date, - author, - github, - } = meta - const route = slug && `/blog/${slug}` - - // Slugified headings - const slugger = new GitHubSlugger() - const h1 = (props) => - const h2 = (props) => - const h3 = (props) => - const h4 = (props) => - const h5 = (props) => - const h6 = (props) => - - return ( - -
- -

{title}

-
- - {image && ( -
- {imageCaption - {imageCaption &&
{imageCaption}
} -
- )} -
- - {children} - -
-
-
- ) -} diff --git a/packages/website/src/blog/og-images/the-story-of-marp-next.png b/packages/website/src/blog/og-images/the-story-of-marp-next.png deleted file mode 100644 index 61c0ad2..0000000 Binary files a/packages/website/src/blog/og-images/the-story-of-marp-next.png and /dev/null differ diff --git a/packages/website/src/components/blog/heading.js.jsx b/packages/website/src/components/blog/heading.js.jsx deleted file mode 100644 index d4d2077..0000000 --- a/packages/website/src/components/blog/heading.js.jsx +++ /dev/null @@ -1,63 +0,0 @@ -/** @jsx jsx */ -import { css, jsx } from '@emotion/core' -import GitHubSlugger from 'github-slugger' -import innerText from 'react-innertext' - -export const Heading = ({ - anchorOffset = -80, - children, - level = 1, - slugger = new GitHubSlugger(), - ...props -}) => { - const anchor = slugger.slug(innerText(children)) - const Tag = `h${level}` - - return ( - <> - - - .anchor-link { - align-items: center; - bottom: 0; - display: none; - justify-content: center; - left: -32px; - overflow: hidden; - position: absolute; - top: 0; - width: 32px; - } - - &:hover > .anchor-link { - display: flex; - } - `} - > - - {children} - - - - ) -} diff --git a/packages/website/src/components/button.js.jsx b/packages/website/src/components/button.js.jsx deleted file mode 100644 index 9954dd2..0000000 --- a/packages/website/src/components/button.js.jsx +++ /dev/null @@ -1,111 +0,0 @@ -/** @jsx jsx */ -import { css, jsx } from '@emotion/core' - -const btnShadow = '0 3px 6px rgba(0, 0, 0, 0.25)' -const btnShadowFocus = '0 0 0 0.15em #67b8e3' - -const button = css` - appearance: none; - border-radius: 1.5em; - border: 0; - box-shadow: ${btnShadow}; - box-sizing: content-box; - cursor: pointer; - display: inline-block; - font: inherit; - letter-spacing: inherit; - line-height: inherit; - font-weight: bold; - outline: 0; - overflow: hidden; - margin: 0; - padding: 0.6em 0.95em; - text-decoration: none; - user-select: none; - white-space: nowrap; - - &:hover { - transition: color 0.15s linear, background-color 0.15s linear; - - &:active { - transition: none; - } - } - - &:focus { - box-shadow: ${btnShadowFocus}, ${btnShadow}; - } -` - -const outline = css` - padding: 0.475em 0.825em; -` - -const colors = { - default: { - common: css` - background-color: #fff; - color: #444; - - &:hover { - color: #444; - background-color: #f8f8f8; - - &:active { - color: #444; - background-color: #e0e0e0; - } - } - `, - outline: css` - border: 0.125em solid #444; - `, - }, - primary: { - regular: css` - color: #fff; - background: #0288d1 - linear-gradient(30deg, transparent, rgba(255, 255, 255, 0.3)); - - &:hover { - color: #fff; - background-color: #0277b7; - - &:active { - color: #fff; - background-color: #02669d; - } - } - `, - outline: css` - color: #0288d1; - border: 0.125em solid #0288d1; - background-color: #fff; - - &:hover { - color: #fff; - background-color: #0288d1; - - &:active { - color: #fff; - background-color: #0277b7; - border-color: #0277b7; - } - } - `, - }, -} - -export const Button = (props) => { - const color = colors[props.color] || colors.default - const style = [ - button, - color.common, - props.outline && outline, - color[props.outline ? 'outline' : 'regular'], - props.css, - ] - - if (props.href) return - return -

-
-
- - - {example(resolvePath)} - -
-
- -