Giter Club home page Giter Club logo

tinplate's Introduction

TINplate

GitHub

๐Ÿ“” -> ๐Ÿ’ญ ๐Ÿ’ก ๐ŸŽˆ Template of ICPC Notebooks

Usage

Basic usage

  1. Install dependencies:

  2. Install fonts

    Download font files then run sudo cp -r /path/to/download/fonts /usr/share/fonts/truetype/ && fc-cache -f

    Run fc-list | grep Fira to check installation status

  3. Clone this repo and then open it

  4. Run python -m pip install -r requirements.txt to install requirements

  5. Run python manager.py run to generate all the contents and compile notebook.tex

Full usage

Run python manager.py --help to see all the commands.

Configuration

All the configuration is in config.yml

# The parent folder of `notebook_code_dir`, `notebook_doc_dir` and `cheatsheet_dir`
src_dir: src
# The folder contains all the codes which will be listed
notebook_code_dir: code
# The folder contains all the documentation
notebook_doc_dir: doc
# The folder contains all the cheatsheet documentation
cheatsheet_dir: cheatsheet

# The folder contains all the test codes
test_dir: test

# The name of the file that will be compiled
notebook_file: notebook

# Listing all test code before compiling if `true`
export_testcode_in_notebook: true

# Notebook config
notebook:
  # Chapters config, the content will be generated in the order of this field
  chapters:
    # Should be formed in: ${chapter_key}: ${title}
    # All the chapter is titled as ${title},
    # and all resources for the following sections of each chapters should be placed in these folders:
    # - code: ${src_dir}/${notebook_code_dir}/${chapter_key}
    # - documentation: ${src_dir}/${notebook_doc_dir}/${chapter_key}
    # - test code: ${test_dir}/${chapter_key}

    example: Example

  # Section config
  sections:
    # Config of sections following the chapter ${chapter_key}
    example:
      # Should be an array, the elements of which should be formed in:
      #    ${section_key}: ${title}
      #    code_ext: ${extension_name_of_code}
      #    test_ext: ${extension_name_of_test_code}
      # The relevant files should be in:
      # - code: ${src_dir}/${notebook_code_dir}/${chapter_key}/${section_key}.${extension_name_of_code}
      # - documentation: ${src_dir}/${notebook_doc_dir}/${chapter_key}/${section_key}.tex
      # - test code: ${test_dir}/${chapter_key}/${section_key}.${extension_name_of_test_code}

      - helloworld: Hello
        code_ext: hpp
        test_ext: cpp

# Cheatsheet config
cheatsheets:
  # Should be formed in: ${cheatsheet_key}: ${title}
  # The relevant files should be in: ${src_dir}/${cheatsheet_dir}/${cheatsheet_key}.tex
  example: Euler formula
  example2: A sequence

# Code style config, will be used in linting and compiling PDF
default_code_style: common
code_styles:
  # Should be formed in: ${extension_name}: ${code_style_name}
  C: cpp
  cc: cpp
  cp: cpp
  cpp: cpp
  CPP: cpp
  c++: cpp
  cxx: cpp
  H: cpp
  hh: cpp
  hp: cpp
  h++: cpp
  hpp: cpp
  HPP: cpp
  hxx: cpp

# Compiling test code command config, ${filename} is the name of file that will be compiled
test_commands:
  cpp:
  - g++
  - ${filename}

# Linting command config, ${filename} is the name of file that will be linted
formatting_commands:
  cpp:
    - clang-format
    - -style=file
    - -i
    - ${filename}

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.