• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

mraible/infoq-mini-book: Template project for creating an InfoQ Mini-Book with A ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

mraible/infoq-mini-book

开源软件地址(OpenSource Url):

https://github.com/mraible/infoq-mini-book

开源编程语言(OpenSource Language):

CSS 77.7%

开源软件介绍(OpenSource Introduction):

An InfoQ Mini-Book

Actions Status

This is an awesome book. It’s written in AsciiDoc and compiles to HTML, PDF, and EPUB using the Asciidoctor Gradle plugin.

Installing

npm run setup

Building

To convert this book to HTML and EPUB, run the following command:

npm run build
  • Open build/asciidoc/html5/index.html in your browser to see the generated HTML file.

  • Open build/asciidoc/pdf-prepress/index.pdf to see the 6x9" printable PDF file.

  • Open build/asciidoc/pdf-screen/index.pdf to see the downloadable 8.5x11" PDF file.

  • Open build/asciidoc/epub3/index.epub in iBooks to see the generated EPUB file.

To generate a static site using Antora, run the following command:

npm run build:site

Sweet Authoring Experience

If you’d like a very pleasant authoring experience, the project provides build files that make it possible. First of all, you’ll need to run gradlew once. After running it once, you can run ./gradlew watch to watch for any changes and recompile files as you save them.

To have a similar awesome experience (watch and auto-reload) in your browser, install Node.js on your machine.

After installing Node, you can run the following command to install development tools (like Browsersync).

npm install
Tip
You will only need to run this command when dependencies change in package.json.

Now you can run the following command:

npm run watch

This will start two daemons:

  1. Gradle, which will watch the file system and rebuild the HTML version continuously using Asciidoctor

  2. BrowserSync, which will serve the updated HTML version all of the time and make it available over HTTP

Thanks to this, you’ll have a constantly up to date HTML version available in your browser while editing.

Similarly, you can run the following command to continuously watch the file system and rebuild the static site:

npm run watch:site

Update Dependencies

To update the dependencies in build.gradle, run:

./gradlew useLatestVersions

To update the dependencies in package.json, install npm-check-updates and run it:

npm i -g npm-check-updates
ncu

Releasing/Publishing

This project includes GitHub action workflows to build and publish the book (PDF, EPUB, HTML). To trigger this, you have two options:

  • Run the following script: npm run release

  • Use GitHub’s UI to create the release from your book repository

Once completed, the publish workflow will attach the generated files to the release page.

The benefit of the release npm script is that the version will be updated automatically in the package.json and version.txt files. The version will be reflected in the generated files because the version in version.txt is used as the Gradle project version when building the book.

Note that in order for the release npm script to work, you’ll need to make sure that a GITHUB_TOKEN environment variable is available, as explained in release-it’s documentation.

Deploy to Netlify

To deploy this repository to Netlify, create an account and log in.

  1. Select New site from Git

  2. Select your Git provider

  3. Select your repository

  4. Select the branch to deploy

  5. Build command: npm run build:site

  6. Publish directory: public/

  7. Click Deploy site

Your site should take less than a minute to deploy, depending on the size of your book.

Netlify Preview

This repository is using a netlify.toml configuration file to build and publish the static site to Netlify. You can see the result at: https://infoq-mini-book.netlify.app/.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap