rcdilorenzo / sheets

Generate PDFs from ChordPro files

Home Page:https://music.redeemernc.tech

Repository from Github https://github.comrcdilorenzo/sheetsRepository from Github https://github.comrcdilorenzo/sheets

Running the Docker Image

To run the application using Docker, follow these steps:

  1. Build the Docker image:

    docker build -t sheets-base .
    
  2. Run the Docker container:

    docker run -p 8081:8081 --rm sheets-base
    

    This will start the service and make it available on http://localhost:8081.

Using the API

You can use curl to send requests to the API for both HTML and PDF generation.

Generate HTML

To generate HTML from ChordPro content:

CONTENT=$(cat -A tests/data/we-three-kings.chordpro | sed 's/\$/\\n/g') \
curl -X POST http://localhost:8081/generate_html \
-H "Content-Type: application/json" \
-d @- << EOF
{
"content": "${CONTENT}",
"transpose": 0
}
EOF

Generate PDF

To generate PDF from ChordPro content:

CONTENT=$(cat -A tests/data/we-three-kings.chordpro | sed 's/\$/\\n/g') \
curl -X POST http://localhost:8081/generate_pdf \
--output output.pdf \
-H "Content-Type: application/json" \
-d @- << EOF
{
"content": "${CONTENT}",
"transpose": 0
}
EOF

This will save the generated PDF as output.pdf in your current directory.

Note: Replace the example ChordPro content with your actual content. The transpose parameter is optional and defaults to 0 if not provided.

About

Generate PDFs from ChordPro files

https://music.redeemernc.tech


Languages

Language:TypeScript 55.5%Language:Python 25.9%Language:Dockerfile 6.7%Language:CSS 6.3%Language:Makefile 3.6%Language:JavaScript 1.1%Language:Shell 0.9%