Giter Site home page Giter Site logo

raychenon / play-table-of-contents Goto Github PK

View Code? Open in Web Editor NEW
33.0 3.0 9.0 379 KB

Web app to generate table of contents of markdown file. Built with Play Framework for Scala .

Home Page: http://tableofcontent.eu

License: MIT License

Scala 66.94% CSS 29.20% Shell 0.24% Batchfile 0.30% HTML 3.31%
markdown table-of-contents github scala

play-table-of-contents's Introduction

Build Status - Master MIT licensed

The hosting on "http://tableofcontent.eu" stopped due to costs of AWS.

Introduction

Web based table of contents generator

There are plenty of markdown table of contents generators on github, but the installation of the dependencies is a lot of overhead for an occasional activity. That's the idea of this web app.

In addition, it is a nice tutorial on Scala ๐Ÿ˜„

Online Generation

You don't need to install anything.
1 Go to http://tableofcontent.eu/
2 Copy paste your markdown content or your github repo link and click "submit" "

Run locally

You can run locally, go to the root project and enter this command line.

sbt run

By default, it will run on http://localhost:9000 .

To run on local on a specific port

sbt "~run 8081"

Docker

Build

At the root of the project, run the command line and pass in parameter your username on https://hub.docker.com/

$ ./build-docker-image.sh <DOCKER_HUB_USERNAME>

Run locally

See the last Docker image build

$ docker images

To run locally, use the cmd

$ docker run --name <CONTAINER_NAME> -p <FROM_PORT>:<TO_PORT> -d <IMAGE_ID>

# for examples :
$ docker run --name container -p 9000:9000 -d e2a451cb675f

The application will run on "http://localhost:9000".

To stop every Docker processes from running .

$ docker stop $(docker ps -a -q)

Then once the containers stop running, you can delete the containers.

$ docker rm $(docker container ps -a -q)

Run on AWS Lightsail

The instance is already set up. Go to the console and run this command:

$ sudo docker run --name toc -p 80:9000 -d raychenon/play-table-of-contents:<tag>

play-table-of-contents's People

Contributors

raychenon 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

Watchers

 avatar  avatar  avatar

play-table-of-contents's Issues

Test coverage

Add tests especially in the table of contents generation logic ( TableOfContentHelper)
Use Specs2 .

Indent incorrect if Heading contains #

# PKCS
# PKCS#11

is currently rendered as

**[Table of Contents](http://tableofcontent.eu)**
<!-- Table of contents generated generated by http://tableofcontent.eu -->
- [PKCS](#pkcs)
  - [PKCS#11](#pkcs11)

but it should have been

**[Table of Contents](http://tableofcontent.eu)**
<!-- Table of contents generated generated by http://tableofcontent.eu -->
- [PKCS](#pkcs)
- [PKCS#11](#pkcs11)

Escaping the hashtag leads to the same result...

Better slugification

Link are incorrect with special chars, examples:

  • promises::all([ mapper ]) โ†’ #promisesall-mapper- (#promises::all([-mapper-]))
  • join(p1, ..., pn, cb) / join([p1, ..., pn], cb) โ†’ #joinp1--pn-cb--joinp1--pn-cb (#join(p1,-...,-pn,-cb)-/-join([p1,-...,-pn],-cb))

Improve UI design

  • stop adjust the width of the textarea
  • improve the UX on mobile
  • package the assets in Docker

Serverless ?

See if it is worth to run on serverless as it is idle most of time

HTML should probably be escaped ;)

If the original Markdown code contain raw HTML (that is a purely acceptable syntax in markdown), it does not get escaped in the resulting output. One way around this would be to output to a textarea where HTML won't be rendered (it's also much easier to copy-paste then!)

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.