Skip to content

tmscer/parshape

Repository files navigation

Parshape

See parshape.com for a live version.

This project came to be as a semestral work in subject Typography and TeX. Subject page on CTU's website can be found here.

List of features

  • draw a shape of your paragraph with
    • lines
    • lines that snap to a multiple of 15°
    • half-circles
    • n-point Bézier curve
  • configure the app close to your TeX environment, this project can use
    • \baselineskip and \lineskip
    • \hsize and \vsize
    • \pagewidth and \page height
    • offset of text start: \hoffset, \pdfhorigin, \voffset and \pdfvorigin

Static Build

Static Build

To obtain a static build click the badge above and go to the latest build. On successful static builds, there is a section called Artifacts with a ZIP file.

To serve the contents of the ZIP file, unpack it and serve using any HTTP server. My favourite way to do so is using

$ npx http-server -p 9000 &  # ensure you are in the correct directory
$ firefox localhost:9000

To create a build locally, run

$ npm run build:static

after setting up your development environment using instructions below.

Local development

Required programs:

  • Node.js version >= 14 and compatible NPM

To get started, run the following commands:

$ npm install  # install dependencies
$ npm run dev  # run local development server

A local build can be made with

$ npm run build

and served with

$ npm run start

Documentation

This project is documented in two ways: code with its tests and a PDF file.

Code and tests

Ideally all code should be tested -- don't understand what a line of code does? Try to change it or remove it and see what functionality breaks and which tests don't pass. Still have no clue? File an issue.

React components should be understandable to a React developer. For everything else there should be readable code (explanatory variables, short functions) and tests.

Jest is the chosen test runner. To run all tests, use:

$ npm run test  # or `npm run test:watch` when developing

PDF

Build Docs

To obtain the PDF doc file, click the badge above and select the latest successful run from branch master. The PDF contains high-level introduction to the project and explanation of some used algorithms and math formulas.

If you wish to compile the TeX source yourself, go to ./doc and run

$ lautex -fmt optex parshape.tex

About

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors