Commit 9bc4e90a authored by IBUTA, Kakeru's avatar IBUTA, Kakeru

initial commit

parents
Pipeline #128231932 canceled with stages
in 10 minutes and 51 seconds
/node_modules
/public
stages:
- build
- makepdf
- deploy
build:
image: node:11-alpine
stage: build
variables:
GIT_SUBMODULE_STRATEGY: recursive
script:
- yarn install
- npx gulp web
- npx gulp print
artifacts:
paths:
- public
expire_in: 1 week
cache:
paths:
- node_modules/
makepdf:
image: buildkite/puppeteer
stage: makepdf
variables:
GIT_STRATEGY: none
before_script:
- wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
- apt update
- apt install -y fontconfig unzip poppler-utils ghostscript
- mkdir -p ./fonts
- wget -q -N -P ./fonts https://noto-website-2.storage.googleapis.com/pkgs/NotoSerifCJKjp-hinted.zip
- wget -q -N -P ./fonts https://noto-website-2.storage.googleapis.com/pkgs/NotoSansCJKjp-hinted.zip
- wget -q -N -P ./fonts https://github.com/adobe-fonts/source-han-mono/releases/download/1.002/SourceHanMono.ttc
- mkdir -p /usr/share/fonts/opentype/noto
- unzip -o ./fonts/NotoSerifCJKjp-hinted.zip -d /usr/share/fonts/opentype/noto/
- unzip -o ./fonts/NotoSansCJKjp-hinted.zip -d /usr/share/fonts/opentype/noto/
- cp ./fonts/SourceHanMono.ttc /usr/share/fonts/opentype/noto/
- chmod 644 -R /usr/share/fonts/opentype/noto/
- fc-cache -fv
- yarn global add @vivliostyle/cli press-ready
script:
- ln -s public kosys-newsletter-202006
# 塗り足し3mm込みのサイズ148+3*2, 210+3*2
- vivliostyle build --no-sandbox -r ./ --size '154mm,216mm' -o public/kosys-newsletter-202006-press-src.pdf -b ./kosys-newsletter-202006/print/manifest.html
- press-ready build --input ./public/kosys-newsletter-202006-press-src.pdf --output ./public/kosys-newsletter-202006-press.pdf --enforce-outline --boundary-boxes
artifacts:
paths:
- public
expire_in: 1 week
cache:
paths:
- fonts/
dependencies:
- build
pages:
image: alpine
stage: deploy
variables:
GIT_STRATEGY: none
script:
- ls
artifacts:
paths:
- public
expire_in: 1 week
dependencies:
- makepdf
only:
- master
{
// IntelliSense を使用して利用可能な属性を学べます。
// 既存の属性の説明をホバーして表示します。
// 詳細情報は次を確認してください: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"useWSL": true,
"name": "Launch Program",
"program": "${workspaceRoot}/node_modules/gulp/bin/gulp.js"
},
{
"type": "node",
"request": "launch",
"name": "Run NPM script in WSL",
"useWSL": true,
"localRoot": "${workspaceFolder}",
"remoteRoot": "${command:extension.vscode-wsl-workspaceFolder}",
"runtimeExecutable": "npm",
"runtimeArgs": [
"run-script",
"dev"
],
"internalConsoleOptions": "openOnSessionStart",
"skipFiles": [
"<node_internals>/**/*.js",
],
}
]
}
\ No newline at end of file
<template>
<div class="author web-only">
著:{{ $frontmatter.author }}
</div>
</template>
<template>
<aside class="author-profile-item">
<strong class="author-heading"><span v-if="authorTitle" class="author-title">{{ authorTitle }}</span><span class="author-name">{{ authorName }}</span></strong>
<div class="author-description">
<slot></slot>
</div>
</aside>
</template>
<script>
export default {
props: ['authorName', 'authorTitle'],
computed: {
isSlotAssigned(){
if(this.$slots.default && this.$slots.default.length > 0){
return this.$slots.default[0].text;
}
return false;
}
}
};
</script>
<template>
<aside class="author-profile">
<slot></slot>
</aside>
</template>
<template>
<div>
<table class="financialSheet">
<colgroup>
<col class="col-accountName">
<col class="col-balance">
<col class="col-balance">
<col class="col-balance">
</colgroup>
<thead>
<tr>
<th>科目</th>
<th colspan="3">金額</th>
</tr>
</thead>
<tbody>
<tr v-for="item in sheetData" :class="item.cssClass">
<td class="accountName">{{ item.accountName }}</td>
<td class="balance balance-1">{{ item.balance1 | formatCurrency }}</td>
<td class="balance balance-2">{{ item.balance2 | formatCurrency }}</td>
<td class="balance balance-3">{{ item.balance3 | formatCurrency }}</td>
</tr>
</tbody>
</table>
</div>
</template>
<script>
export default {
props: ['sheetData'],
filters: {
formatCurrency: function (value) {
if (value === null) { return ""; }
var isNegative = false;
if (value < 0) { isNegative = true; value = -value; }
const formatter = new Intl.NumberFormat('ja-JP');
var formattedString = (isNegative ? "" : "") + formatter.format(value);
return formattedString;
}
}
};
</script>
const { path } = require('@vuepress/shared-utils');
module.exports = (ctx) => {
var plugins = [
// '@kosys-docs/vuepress-plugin-search'
];
var base = "/kosys-newsletter-202006/";
var dest = "public/";
//印刷モードの場合
if (ctx.options.theme === "@kosys-docs/vuepress-theme-print") {
theme = '@kosys-docs/vuepress-theme-print';
plugins.push("@kosys-docs/book-manifest-generator");
base += "print/";
dest = "public/print/";
} else {
theme = "@kosys-docs/vuepress-theme-local";
}
return {
title: 'こうしす! Newsletter 2020.6',
description: '会報',
base: base,
dest: dest,
locales: {
"/": {
lang: "ja"
}
},
plugins: plugins,
theme: theme,
themeConfig: {
sidebar: [
'/frontcover',
'/',
'/message',
{
title: '活動報告',
path: "/chapter1_index",
collapsable: false,
children: [
'/chapter1_section1',
'/chapter1_section2'
]
},
{
title: '寄稿記事',
path: "/chapter2_index",
collapsable: false,
children: [
'/chapter2_xxxx',
]
},
'/postscript',
'/colophon',
'/backcover',
]
},
bookConfig: {
author: "OPAP-JP contributors",
bookUrl: "https://kosys.gitlab.io/kosys-newsletter-202006/print/",
cover: "cover.png",
coverFormat: "image/png"
}
};
};
\ No newline at end of file
"use strict";
const { fs, path } = require("@vuepress/shared-utils");
const CopyPlugin = require("copy-webpack-plugin");
module.exports = (options, ctx) => ({
chainWebpack (config, isServer) {
if (!isServer){ return; }
var publicPrintDir = path.join(ctx.vuepressDir, "public.print");
if (fs.existsSync(publicPrintDir)) {
config
.plugin("copy")
.use(
CopyPlugin,
[[
{ from: publicPrintDir , to: ctx.outDir }
]]
);
}
},
async generated (pagePaths) {
const { generateBookManifest } = require("./manifestGenerator.js")(ctx);
generateBookManifest();
}
});
"use strict";
const { fs, path, parseFrontmatter } = require('@vuepress/shared-utils');
module.exports = (ctx) => {
function convertSidebarToBookManifest(sidebar) {
return {
"@context": ["https://schema.org", "https://www.w3.org/ns/wp-context"],
"type": "Book",
"url": ctx.siteConfig.bookConfig.bookUrl,
"author": ctx.siteConfig.bookConfig.author,
"dateModified": "",
"readingOrder": getAllPageUrls(sidebar),
"resources": [
{
"type": "LinkedResource",
"rel": "https://www.w3.org/ns/wp#cover-page",
"url": ctx.siteConfig.bookConfig.cover,
"encodingFormat": ctx.siteConfig.bookConfig.coverFormat,
}
]
};
}
function getAllPageUrls(nodes) {
var pageUrls = [];
nodes.forEach(function(i) {
var node_type = "";
if (typeof(i) === "string") {
node_type = "section";
} else {
node_type = "chapter";
}
if (node_type == "chapter") {
if(i.path) {
const page = findPage(i.path);
pageUrls.push(getUrl(page.regularPath));
}
if(i.children) {
pageUrls = pageUrls.concat(getAllPageUrls(i.children));
}
} else if(node_type == "section") {
const page = findPage(i);
if(page) {
pageUrls.push(getUrl(page.regularPath));
}
}
});
return pageUrls;
}
function findPage(path) {
const foundPages = ctx.pages.filter(page => path === page.regularPath || path + ".html" === page.regularPath );
if (foundPages.length > 0) {
return foundPages[0];
} else {
return null;
}
}
function getUrl(pagePath) {
if (pagePath.startsWith("/")) {
pagePath = pagePath.slice(1);
}
var url = ctx.siteConfig.base + pagePath;
return url;
}
return {
generateBookManifest() {
const sidebar = ctx.themeConfig.sidebar;
const manifest = convertSidebarToBookManifest(sidebar);
const manifestFilePath = path.join(ctx.outDir, "manifest.json");
fs.writeFileSync(manifestFilePath, JSON.stringify(manifest));
}
}
}
{
"name": "@kosys-docs/vuepress-plugin-book-manifest-generator",
"version": "1.0.0",
"description": "",
"main": "index.js",
"author": "OPAP-JP contributors",
"license": "MIT",
"dependencies": {
"copy-webpack-plugin": "^4.5.1"
}
}
The MIT License (MIT)
Copyright (c) 2019-present, OPAP-JP contributors.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Bundled Fonts
--------------
Google Fonts
https://fonts.google.com/attribution
Noto Serif JP SIL Open Font License, 1.1
NotoSerifJP-ExtraLight.otf: Copyright 2017 Adobe Systems Incorporated (http://www.adobe.com/).
NotoSerifJP-Light.otf: Copyright 2017 Adobe Systems Incorporated (http://www.adobe.com/).
NotoSerifJP-Regular.otf: Copyright 2017 Adobe Systems Incorporated (http://www.adobe.com/).
NotoSerifJP-Medium.otf: Copyright 2017 Adobe Systems Incorporated (http://www.adobe.com/).
NotoSerifJP-SemiBold.otf: Copyright 2017 Adobe Systems Incorporated (http://www.adobe.com/).
NotoSerifJP-Bold.otf: Copyright 2017 Adobe Systems Incorporated (http://www.adobe.com/).
NotoSerifJP-Black.otf: Copyright 2017 Adobe Systems Incorporated (http://www.adobe.com/).
Noto Sans JP SIL Open Font License, 1.1
NotoSansJP-Thin.otf: Copyright 2012 Google Inc. All Rights Reserved.
NotoSansJP-Light.otf: Copyright 2012 Google Inc. All Rights Reserved.
NotoSansJP-Regular.otf: Copyright 2012 Google Inc. All Rights Reserved.
NotoSansJP-Medium.otf: Copyright 2012 Google Inc. All Rights Reserved.
NotoSansJP-Bold.otf: Copyright 2012 Google Inc. All Rights Reserved.
NotoSansJP-Black.otf: Copyright 2012 Google Inc. All Rights Reserved.
# @kosys-docs/vuepress-theme-print
Simple theme for pre-processing of print version of docs.
This theme renders very simple html only.
export default {
created () {
if (this.$ssrContext) {
// style tag to override css
// for styles which cannot be scoped such as @page rule.
this.$ssrContext.overrideStyle = '';
const userOverrideStyles = this.$frontmatter.overrideStyles;
var style = renderOverrideStyle(userOverrideStyles);
if (style !== ""){
this.$ssrContext.overrideStyle = `<style>${style}</style>`;
}
function renderOverrideStyle(data) {
var style = "";
if (Array.isArray(data)){
style = data.join("\n");
} else if (typeof (data) == "string") {
style = data;
}
return " " + style + " ";
}
}
}
}
\ No newline at end of file
const { path } = require("@vuepress/shared-utils");
module.exports = (options, ctx) => ({
clientRootMixin: path.resolve(__dirname, 'clientRootMixin.js')
});
\ No newline at end of file
<template>
<section class="chapter-cover">
<h1 class="title">{{ $page.title }}</h1>
<div class="description">
<Content/>
</div>
</section>
</template>
\ No newline at end of file
<template>
<section class="section" :class="$page.frontmatter.sectionClass">
<header class="section-header">
<h1 class="title">{{ $page.title }}</h1>
<p class="author">{{ $frontmatter.author }}</p>
<p class="summary"><Content slot-key="summary"/></p>
</header>
<main class="section-content" :class="$page.frontmatter.contentClass">
<Content/>
</main>
</section>
</template>
{
"name": "@kosys-docs/vuepress-theme-print",
"version": "1.0.6-31",
"description": "Simple theme for pre-processing of print version of docs.",
"repository": "gitlab:kosys/kosys-docs-vuepress-theme-print",
"main": "index.js",
"author": "OPAP-JP contributors",
"license": "MIT",
"dependencies": {
"@vuepress/shared-utils": "^1.0.0-alpha.37"
}
}
@charset "utf-8";
@page {
counter-increment: doc-page;
size: A5;
bleed: 3mm;
margin: 15mm 15mm 10mm 15mm;
}
@page:left {
@top-left {
font-size: 9pt;
content: counter(doc-page);
border-bottom: solid black 1px;
margin-bottom: 5mm;
}
}
@page:right {
@top-right {
font-size: 9pt;
content: counter(doc-page);
border-bottom: solid black 1px;
margin-bottom: 5mm;
}
}
body {
font-family: 'Source Han Serif', 'Source Han Serif JP', 'Noto Serif JP', 'Custom Emoji Font', serif;
font-size: 10pt;
font-weight: 300;
}
h1, h2, h3, h4, h5 {
font-family: 'Source Han Sans', 'Source Han Sans JP', 'Noto Sans JP', 'Custom Emoji Font', sans-serif;
}
.section-content h1,
.chapter-cover .description h1 {
display: none;
}
p {
text-indent: 1rem;
}
img { max-width: 100%; }
<!DOCTYPE html>
<html lang="{{ lang }}" class="print">
<head>
<meta charset="utf-8">
<title>{{ title }}</title>
{{{ renderStyles() }}}
{{{ overrideStyle }}}
</head>
<body>
<!--vue-ssr-outlet-->
</body>
</html>
\ No newline at end of file
<template>
<aside class="global-footer">
<small class="copyright">Copyright © <a href="https://opap.jp/contributors">OPAP-JP contributors</a>. </small>
</aside>
</template>
<style lang="stylus">
.global-footer {
text-align: center;
border-top: solid 1px #DDD;
margin-top: 1em;
padding-top: 1rem;
a {
color: glay;
display: inline-block;
margin: 0 0.5em;
}
}
</style>
module.exports = {
extend: '@vuepress/theme-default'
}
\ No newline at end of file
<template>
<ParentLayout>
<GlobalFooter slot="page-bottom"/>
</ParentLayout>
</template>
<script>
import ParentLayout from '@parent-theme/layouts/Layout.vue'
import GlobalFooter from '@theme/components/GlobalFooter.vue'
export default {
components: {
ParentLayout,