Skip to content

Commit

Permalink
Font family (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
manhtai authored Apr 3, 2022
1 parent c6666a3 commit 83ee072
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 19 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ A manual written in Bookless (WIP): https://bookless.github.io
- [x] Export books to PDF / ePub / HTML
- [x] Cross-platform: Windows, macOS, Linux
- [ ] Multilingual spelling check
- [ ] Beautiful book template

## Installation

Expand Down
4 changes: 2 additions & 2 deletions release/app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion release/app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bookless",
"version": "0.1.1",
"version": "0.1.2",
"description": "Hassle-free book-writing app",
"main": "./dist/main/main.js",
"author": {
Expand Down
9 changes: 5 additions & 4 deletions src/main/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import { JSON, Meta } from '../renderer/state/AppState';
import { bookless2pandoc, loadConfig } from './config';

const exportFormats = [
{ name: 'PDF (pdf)', extensions: ['pdf'] },
{ name: 'EPUB (epub)', extensions: ['epub'] },
{ name: 'HTML (html)', extensions: ['html'] },
{ name: 'PDF', extensions: ['pdf'] },
{ name: 'EPUB', extensions: ['epub'] },
{ name: 'HTML', extensions: ['html'] },
];

const markdownExt =
'markdown+header_attributes+footnotes+tex_math_dollars+implicit_figures+link_attributes+grid_tables';
'markdown+header_attributes+footnotes+tex_math_dollars+implicit_figures+link_attributes+grid_tables+yaml_metadata_block';

interface ExportOptions {
dir: string;
Expand All @@ -39,6 +39,7 @@ const buildOut = (exp: ExportOptions, conf: Meta): Out => {
// Default args
out.output = exp.outputPath;
out.from = markdownExt;
out['data-dir'] = exp.dir;
out['resource-path'] = exp.dir;
out.standalone = true;
out.katex = true;
Expand Down
15 changes: 5 additions & 10 deletions src/renderer/components/Config/Config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,14 @@ const metaKvs: Kv[] = [

const layoutKvs: Kv[] = [
{
name: ConfigKey.font,
label: 'Font',
type: 'select',
options: [
'',
'Georgia, serif',
'Helvetica, Arial, sans-serif',
'Palatino, Palatino Linotype, serif',
],
name: ConfigKey.fontFamily,
label: 'Font family',
type: 'string',
placeholder: 'mathpazo',
},
{
name: ConfigKey.fontSize,
label: 'Font size',
label: 'Font size (px)',
type: 'number',
step: 1,
onLoad: (s) => (s ? parseInt(s, 10).toString() : ''),
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/state/AppState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const ConfigKey = {
author: 'variables.author',
date: 'variables.date',
lang: 'variables.lang',
font: 'variables.mainfont',
fontFamily: 'variables.fontfamily',
fontSize: 'variables.fontsize',
lineHeight: 'variables.linestretch',
headerIncludes: 'variables.headerIncludes',
Expand Down

0 comments on commit 83ee072

Please sign in to comment.