Git Product home page Git Product logo

books.jl's Introduction

Books.jl

Create books with Julia

CI Documentation Code Style Blue

In a nutshell, this package is meant to generate books (or reports or dashboards) with embedded Julia output. Via Pandoc, the package can live serve a website and build various outputs including a website and PDF. For many standard output types, such as DataFrames and plots, the package can run your code and will automatically handle proper embedding in the output documents, and also try to guess suitable captions and labels. Also, it is possible to work via the live server, which shows changes within seconds.

This package assumes that:

  • the user is comfortable with managing two REPLs,
  • the user wants to run Julia code and embed the output in a book,
  • the book (website and PDF) is built via CI, and
  • Markdown sections and subsections (level 2) should be numbered and listed in the HTML menu.

The reason that numbering of sections is always assumed is to allow the book to be printed. Without section numbers, it is difficult to refer to other parts of the book.

If you do not want numbered sections, but instead a more dynamic website with links, then checkout Franklin.jl or my template repository for Franklin with Pluto. If you want a small report instead of a book with numbered sections, then Weave.jl might be more suitable for your problem.

This package is used to create the Julia Data Science book.

Usage

To install this package (Julia 1.6/1.7/1.8 on MacOS/Linux), use

pkg> add Books

See, the documentation for more information.

Windows

Currently, this package (probably) does not work on Windows. This seems to be due to differences in maximum file path lengths. I have to look into it a bit more to fix it, but it's not a priority for me.

Getting help

If you run into problems when using this package, feel free to open an issue here at GitHub or click this link to ask a question at Discourse. For short questions, feel free to send me a PM at https://julialang.zulipchat.com/.

books.jl's People

Contributors

exaclior avatar fangliu-tju avatar findmyway avatar github-actions[bot] avatar henry2004y avatar pitmonticone avatar rikhuijzer avatar storopoli avatar thecedarprince avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

books.jl's Issues

Add ImageOptions

To allow users to specify image size. It could be an ImageOptions struct wrapped around the image. This object can then be passed through convert_output(path, options::Options) because that one converts the objects object to keyword arguments.

function f()
  p = plot()
  imageoptions = ImageOptions(p; width=3cm, height=6cm)
  options = Options(imageoptions; caption="My image")
  return options
end

With this, I don't think it is necessary to also allow for wrapping Options in ImageOptions. When the user does that, try to catch it and show instructions to the user to do it the other way around.

Add Documenter.jl

And the example pages should just be linked to from the Documenter pages.

This improves documentation clarity a lot and allows for different sites per version.

Multilingual support

Let's say I want to work on a little book which supports two languages (en_us, zh_cn). I can create two configs but it seems they share the same index.md, right? How about making it configurable?

Increase DPI further

To test the quality, add Geom.line and check whether aliasing is clearly visible.

Allow setting table captions

For example, for a DataFrame, provide something which prepares the table according to pandoc-crossref

a   b   c
--- --- ---
1   2   3
4   5   6

: Caption {#tbl:label}

Allow calling @sc and @sco via path

With @sc and @sco, it would also be convenient to specify these via _gen/foo-sc. This suffix is possible because Julia doesn't allow for minus signs in function names while it is allowed in file names. So,

foo_bar() = 3

and calling it via

_gen/foo_bar-sc.md

would show the code for the method f.

Rename generate_content

Because it's quite annoying to type generate_content all the time and gen should be reasonably unique.

Duplication in CI.yml

The Pandoc and LaTeX dependencies installation could be moved into Books.jl. Ensure that these installations are not automatically run to mess up the user's system.

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

Allow prefix for all links

Then, users can also host the book while using the GitHub or GitLab Pages domains instead of their own.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.