-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from Ziul/markdown
Markdown
- Loading branch information
Showing
26 changed files
with
2,438 additions
and
1,381 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: LaTeX Build | ||
|
||
on: | ||
push: | ||
paths: | ||
- "*.tex" | ||
- "*.ttf" | ||
- ".github/workflows/*" | ||
- "*.md" | ||
- "**/*.md" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
container: thomasweise/docker-texlive-full | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install TexLive and other dependencies | ||
run: | | ||
apt-get update -qq | ||
# apt-get install -y texlive-full | ||
apt-get install -y latexmk pandoc | ||
- name: Copy fonts and update font cache | ||
run: | | ||
cp -v *.ttf /usr/local/share/fonts | ||
fc-cache -fv | ||
- name: Build LaTeX files | ||
run: | | ||
make convert | ||
make | ||
- id: commit | ||
uses: prompt/actions-commit-hash@v3 | ||
- name: Upload PDF artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: pdf-files | ||
path: | | ||
- name: Release | ||
uses: softprops/action-gh-release@v2 # in the future, try ncipollo/release-action@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ steps.commit.outputs.short }} | ||
name: Release ${{ steps.commit.outputs.short }} | ||
draft: false | ||
prerelease: false | ||
files: | | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
|
||
BIBTEX = bibtex | ||
# LATEX = pdflatex | ||
LATEX = xelatex | ||
DVIPS = dvips | ||
PS2PDF = ps2pdf | ||
TEMPLATE = ieee | ||
|
||
VERSION = 0.1.0 | ||
|
||
SOURCES = $(wildcard ./*.*) | ||
|
||
NPROCS := 1 | ||
OS := $(shell uname) | ||
export NPROCS | ||
|
||
ifeq ($J,) | ||
|
||
ifeq ($(OS),Linux) | ||
NPROCS := $(shell grep -c ^processor /proc/cpuinfo) | ||
else ifeq ($(OS),Darwin) | ||
# NPROCS := $(shell system_profiler | awk '/Number of CPUs/ {print $$4}{next;}') | ||
NPROCS := 1 | ||
endif # $(OS) | ||
|
||
else | ||
NPROCS := $J | ||
endif # $J | ||
|
||
.PHONY: all clean dist-clean | ||
|
||
TEX_FILES := $(shell find . -type f -name "*.tex") | ||
MD_FILES := $(shell find . -type f -name "*.md" | grep -v "README.md") | ||
|
||
all: convert | ||
@echo "Using" $(NPROCS) "jobs" | ||
@for file in $(TEX_FILES); do \ | ||
echo "Processing $$file"; \ | ||
latexmk -xelatex $$file; \ | ||
done | ||
@for file in $(shell find . -type f -name "*.pdf"); do \ | ||
echo "----- $$file"; \ | ||
pdfinfo $$file; \ | ||
done | ||
|
||
convert: | ||
@echo files: $(MD_FILES) | ||
@for file in $(MD_FILES); do \ | ||
echo "Converting $$file" using $(TEMPLATE); \ | ||
output=$${file%.md}.tex; \ | ||
pandoc --read=markdown --write=latex --output=testdoc.tex --template=$(TEMPLATE).latex $$file -o $$output --listings --biblatex --csl abnt.csl ; \ | ||
done | ||
|
||
$(TARGET): $(MAIN_FILE) $(SOURCES) | ||
$(MAKE) clean | ||
$(LATEX) $(MAIN_FILE) | ||
$(LATEX) -interaction=batchmode $(MAIN_FILE) | ||
@mv $(PDF_FILE) $(TARGET) | ||
|
||
clean: | ||
rm -rf *~ *.dvi *.ps *.backup *.aux *.log *.out *.xdv *.fls *.fdb_latexmk | ||
rm -f *.lof *.lot *.bbl *.blg *.brf *.toc *.idx *.lol *.bcf *.xml | ||
|
||
install: | ||
apt update -qq | ||
apt install -y pandoc pandoc-citeproc latexmk | ||
cp -v *.ttf /usr/local/share/fonts | ||
fc-cache -fv |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,85 @@ | ||
DocHell | ||
======= | ||
# IEEE Article Generator | ||
|
||
Modelo de trabalho para faculdade | ||
This project allows the generation of reports or articles in IEEE format using markdown files as input. | ||
|
||
## Contents | ||
|
||
Dependências: | ||
============ | ||
- [Description](#description) | ||
- [Prerequisites](#prerequisites) | ||
- [Installation](#installation) | ||
- [Usage](#usage) | ||
- [Project Structure](#project-structure) | ||
- [Contribution](#contribution) | ||
- [License](#license) | ||
|
||
- texlive-latex-base | ||
- texlive-latex-recommended | ||
- texlive-latex-extra | ||
- texlive-base | ||
- texlive-publishers | ||
- texlive-fonts-recommended | ||
- texlive-generic-recommended | ||
- texlive-lang-german | ||
## Description | ||
|
||
This project provides a simple way to convert markdown files into documents formatted according to IEEE standards. It uses a `Makefile` to automate the conversion process. | ||
|
||
## Prerequisites | ||
|
||
- [Pandoc](https://pandoc.org/installing.html): Pandoc is a universal document converter. | ||
- [LaTeX](https://www.latex-project.org/get/): Required to render the document in PDF format according to IEEE standards. | ||
|
||
## Installation | ||
|
||
1. Clone the repository: | ||
```bash | ||
git clone <REPOSITORY_URL> | ||
cd <REPOSITORY_NAME> | ||
make install | ||
``` | ||
|
||
2. Make sure you have Pandoc and LaTeX installed on your system. | ||
|
||
## Usage | ||
|
||
To generate an IEEE-formatted article from a markdown file, follow these steps: | ||
|
||
1. Place your markdown file in the root of the project or modify the path in the `Makefile`. | ||
|
||
2. Run the make command: | ||
```bash | ||
make | ||
``` | ||
|
||
3. The generated PDF document will be saved in the `output` folder with the name `article.pdf`. | ||
|
||
### Example | ||
|
||
To generate the PDF from the `main.md` file, run: | ||
```bash | ||
make | ||
``` | ||
|
||
## Project Structure | ||
|
||
```plaintext | ||
. | ||
├── Makefile # File to automate document generation | ||
├── main.md # Input markdown file | ||
└── README.md # Project documentation | ||
``` | ||
|
||
## Contribution | ||
|
||
Contributions are welcome! To contribute, follow these steps: | ||
|
||
1. Fork the repository. | ||
2. Create a branch for your feature or bugfix: | ||
```bash | ||
git checkout -b my-feature | ||
``` | ||
3. Commit your changes: | ||
```bash | ||
git commit -m 'Add my feature' | ||
``` | ||
4. Push to the original branch: | ||
```bash | ||
git push origin my-feature | ||
``` | ||
5. Open a Pull Request. | ||
|
||
## License | ||
|
||
This project is licensed under the terms of the MIT license. See the [LICENSE](LICENSE) file for more details. |
Oops, something went wrong.