Skip to content

Commit

Permalink
add theme-techbook
Browse files Browse the repository at this point in the history
  • Loading branch information
MurakamiShinyu committed Jul 26, 2020
1 parent f3d124c commit c7d6f6e
Show file tree
Hide file tree
Showing 5 changed files with 664 additions and 0 deletions.
31 changes: 31 additions & 0 deletions packages/@vivliostyle/theme-techbook/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Techbook

[![](https://img.shields.io/npm/v/@vivliostyle/theme-techbook.svg)](https://npmjs.com/package/@vivliostyle/theme-techbook)
[![npm: total downloads](https://flat.badgen.net/npm/dt/@vivliostyle/theme-techbook)](https://npmjs.com/package/@vivliostyle/theme-techbook)
![npm: license](https://flat.badgen.net/npm/license/@vivliostyle/theme-techbook)

A techbook (技術同人誌) theme for Vivliostyle.

Source: https://github.com/akabekobeko/env-create-book/tree/master/src/scss

## Install

```bash
npm install --save @vivliostyle/theme-techbook
# or
yarn add @vivliostyle/theme-techbook
```

## Use

In `vivliostyle.config.js`:

```js
module.exports = {
theme: '@vivliostyle/theme-techbook',
};
```

## License

CC0 1.0
56 changes: 56 additions & 0 deletions packages/@vivliostyle/theme-techbook/example/techbook.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<section id="brief-history-of-javascript"><h1>Brief History of JavaScript</h1><p>from Wikipedia <a href="https://en.wikipedia.org/wiki/JavaScript">https://en.wikipedia.org/wiki/JavaScript</a></p><nav id="toc" role="doc-toc">
</nav><section id="javascript"><h2>JavaScript</h2><p><strong>JavaScript</strong> (<code>/ˈdʒɑːvəˌskrɪpt/</code>),often abbreviated as JS, is a programming language that conforms to the ECMAScript specification.</p><p>JavaScript is <em>high-level</em>, often just-in-time compiled, and multi-paradigm. It has curly-bracket syntax, dynamic typing, prototype-based object-orientation, and first-class functions.</p><section id="weakly-typed"><h3>Weakly typed</h3><p>JavaScript is weakly typed, which means certain types are implicitly cast depending on the operation used.</p><ul>
<li>The binary <code>+</code> operator casts both operands to a string unless both operands are numbers. This is because the addition operator doubles as a concatenation operator</li>
<li>The binary <code>-</code> operator always casts both operands to a number</li>
<li>Both unary operators (+, -) always cast the operand to a number</li>
</ul><section id="javascript-includes-a-number-of-quirks-that-have-been-subject-to-criticism"><h4>JavaScript includes a number of quirks that have been subject to criticism</h4>








































<table><thead><tr><th>left operand</th><th>operator</th><th>right operand</th><th>result</th></tr></thead><tbody><tr><td>[](empty array)</td><td>+</td><td>[](empty array)</td><td>""(empty string)</td></tr><tr><td>[] (empty array)</td><td>+</td><td>{} (empty object)</td><td>"[object Object]" (string)</td></tr><tr><td>false (boolean)</td><td>+</td><td>[] (empty array)</td><td>"false" (string)</td></tr><tr><td>"123"(string)</td><td>+</td><td>1 (number)</td><td>"1231" (string)</td></tr><tr><td>"123" (string)</td><td>-</td><td>1 (number)</td><td>122 (number)</td></tr></tbody></table><pre class="language-javascript"><code class="language-javascript"><span class="token punctuation">(</span><span class="token string">'b'</span> <span class="token operator">+</span> <span class="token string">'a'</span> <span class="token operator">+</span> <span class="token operator">+</span><span class="token string">'a'</span> <span class="token operator">+</span> <span class="token string">'a'</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token method function property-access">toLowerCase</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment">// "banana"</span></code></pre></section></section></section></section>
</body>
</html>
34 changes: 34 additions & 0 deletions packages/@vivliostyle/theme-techbook/example/techbook.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Brief History of JavaScript

from Wikipedia <https://en.wikipedia.org/wiki/JavaScript>

<nav id="toc" role="doc-toc">
</nav>

## JavaScript

**JavaScript** (`/ˈdʒɑːvəˌskrɪpt/`),often abbreviated as JS, is a programming language that conforms to the ECMAScript specification.

JavaScript is _high-level_, often just-in-time compiled, and multi-paradigm. It has curly-bracket syntax, dynamic typing, prototype-based object-orientation, and first-class functions.

### Weakly typed

JavaScript is weakly typed, which means certain types are implicitly cast depending on the operation used.

- The binary `+` operator casts both operands to a string unless both operands are numbers. This is because the addition operator doubles as a concatenation operator
- The binary `-` operator always casts both operands to a number
- Both unary operators (+, -) always cast the operand to a number

#### JavaScript includes a number of quirks that have been subject to criticism

| left operand | operator | right operand | result |
| ---------------- | -------- | ----------------- | -------------------------- |
| [](empty array) | + | [](empty array) | ""(empty string) |
| [] (empty array) | + | {} (empty object) | "[object Object]" (string) |
| false (boolean) | + | [] (empty array) | "false" (string) |
| "123"(string) | + | 1 (number) | "1231" (string) |
| "123" (string) | - | 1 (number) | 122 (number) |

```javascript
('b' + 'a' + +'a' + 'a').toLowerCase(); // "banana"
```
39 changes: 39 additions & 0 deletions packages/@vivliostyle/theme-techbook/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "@vivliostyle/theme-techbook",
"description": "Techbook (技術同人誌) theme",
"version": "0.0.0",
"author": "Vivliostyle <mail@vivliostyle.org>",
"scripts": {
"dev": "vivliostyle-theme-scripts preview theme.css --layout example/techbook.md"
},
"devDependencies": {
"vivliostyle-theme-scripts": "^0.3.0"
},
"files": [
"*.css"
],
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/vivliostyle/themes.git",
"directory": "packages/@vivliostyle/theme-techbook"
},
"homepage": "https://github.com/vivliostyle/themes",
"keywords": [
"vivliostyle",
"vivliostyle-theme"
],
"license": "CC0-1.0",
"vivliostyle": {
"theme": {
"name": "Techbook",
"category": "misc",
"style": "./theme.css",
"topics": [
"Techbook"
]
}
}
}
Loading

0 comments on commit c7d6f6e

Please sign in to comment.