Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New pirilampo #59

Merged
merged 136 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
136 commits
Select commit Hold shift + click to select a range
46538bd
move to module
clagomess Feb 28, 2024
e454bef
wip move
clagomess Feb 28, 2024
266e4f7
wip
clagomess Feb 28, 2024
a575f5d
wip
clagomess Feb 28, 2024
9939d8a
wip
clagomess Feb 29, 2024
e9ce93c
wip
clagomess Feb 29, 2024
815cfc1
wip
clagomess Feb 29, 2024
0cad43a
wip
clagomess Feb 29, 2024
c2f8b2c
wip
clagomess Feb 29, 2024
bf090ea
wip
clagomess Mar 1, 2024
7309240
wip
clagomess Mar 1, 2024
57fc7be
wip unit
clagomess Mar 1, 2024
760c688
done
clagomess Mar 2, 2024
cbe48c3
gen images
clagomess Mar 2, 2024
8da01d8
done
clagomess Mar 2, 2024
bfe8e13
add todo
clagomess Mar 2, 2024
260c072
wip unit
clagomess Mar 2, 2024
3de592f
wip unit
clagomess Mar 2, 2024
3c1e1a0
wip unit
clagomess Mar 3, 2024
049b280
moved
clagomess Mar 3, 2024
71f2744
moved
clagomess Mar 3, 2024
b70daca
Merge remote-tracking branch 'gherkin-gen/master' into gherkin-gen
clagomess Mar 3, 2024
ea58a08
move
clagomess Mar 3, 2024
de870ce
add ignore
clagomess Mar 3, 2024
db1983a
impl. getOutArtifact
clagomess Mar 3, 2024
5f017b4
refactor getFeatureExtension
clagomess Mar 3, 2024
ee7b2c4
refactor getFeaturePathWithoutAbsolute
clagomess Mar 3, 2024
83b6337
refactor getAbsolutePathFeatureAsset
clagomess Mar 3, 2024
66da4fc
fix menu nullptr
clagomess Mar 4, 2024
fead17e
impl unit for ParseDocument.format
clagomess Mar 4, 2024
de3d165
impl unit for ParseDocument.format fix
clagomess Mar 4, 2024
11a1b26
wip refactor ParseDocument.format
clagomess Mar 4, 2024
2bd1be3
imp. unit for ParseDocument.setIndiceValue
clagomess Mar 4, 2024
9512cab
refactor ParseDocument.setIndiceValue - improve performance
clagomess Mar 4, 2024
ab24fba
some refactor feature index
clagomess Mar 4, 2024
80fd7a9
change order putIndexValue
clagomess Mar 4, 2024
72d6ee8
impl. unit for ParseImage.parse
clagomess Mar 4, 2024
b8f70ae
refator ParseImage.parse
clagomess Mar 4, 2024
2564715
reduce unit lines
clagomess Mar 4, 2024
75cc355
fix getFeatureMetadata that was ignoring master basepath
clagomess Mar 4, 2024
a3ff677
improve performance diffMaster - reduce comparing
clagomess Mar 5, 2024
0a049f1
fix index map key
clagomess Mar 5, 2024
d6c7e58
rename attr
clagomess Mar 5, 2024
25fa4ac
impl. unit for ParseMenu
clagomess Mar 6, 2024
a434690
refactor ParseMenu
clagomess Mar 6, 2024
f14ff9a
translation
clagomess Mar 6, 2024
d073f7a
move classes
clagomess Mar 6, 2024
247530c
wip refactor maven
clagomess Mar 6, 2024
e05d42d
fix group id
clagomess Mar 6, 2024
d781f09
refactor package name
clagomess Mar 6, 2024
0d3bd7a
impl. MainOptions
clagomess Mar 6, 2024
59aedc2
impl. unit for ParametersDto.validate
clagomess Mar 6, 2024
d4d34f7
impl. validations on projectMasterSource and projectSource at Paramet…
clagomess Mar 6, 2024
9033686
impl. validations on menuColor and menuTextColor at ParametersDto.val…
clagomess Mar 7, 2024
89df440
add validation at MainOptions
clagomess Mar 7, 2024
159c583
main cli done; add todo's; fix getOutArtifact
clagomess Mar 7, 2024
37225ea
wip set PdfParser to parse features as chunk
clagomess Mar 7, 2024
35bfa4b
impl new PdfImageProvider
clagomess Mar 7, 2024
3d5193e
set new image provider
clagomess Mar 7, 2024
2d6d11d
some refactor
clagomess Mar 7, 2024
1f63708
impl. ordered listFolder
clagomess Mar 7, 2024
77708d0
fix some unit and todo's
clagomess Mar 7, 2024
a67fb25
impl. timer
clagomess Mar 8, 2024
35a08e2
impl. removal of buffers and corrupted artifacts
clagomess Mar 8, 2024
658d5f2
created unit for buildIndex
clagomess Mar 8, 2024
ed21584
move PropertiesCompiler
clagomess Mar 8, 2024
f1ceb46
refactor parameter compiler
clagomess Mar 8, 2024
78507f6
impl. store config
clagomess Mar 8, 2024
010e40d
fix performance write index
clagomess Mar 8, 2024
6cb6a18
fix performance file stream
clagomess Mar 8, 2024
868d136
fix InputStream not closed
clagomess Mar 8, 2024
ae64083
change order matches to improve performance
clagomess Mar 8, 2024
46e4625
impl. menu
clagomess Mar 8, 2024
2faf022
fix unit
clagomess Mar 8, 2024
44377a5
alternative to build index with small output
clagomess Mar 9, 2024
4d3cda8
impl. index at UI
clagomess Mar 11, 2024
29fabe0
add progress FI
clagomess Mar 11, 2024
d7c4df8
wip ui
clagomess Mar 11, 2024
e3ae152
wip ColorChooserComponent
clagomess Mar 11, 2024
3669ab7
wip FileChooserComponent
clagomess Mar 11, 2024
07466a4
refactor log4j and appender
clagomess Mar 12, 2024
ca8afe2
add compiler action
clagomess Mar 12, 2024
bbf1c43
add messages
clagomess Mar 12, 2024
aaa99f5
fix progress master
clagomess Mar 12, 2024
435cc20
add text listener
clagomess Mar 12, 2024
b54b13b
fix out jar's
clagomess Mar 12, 2024
6c1020d
move resources
clagomess Mar 12, 2024
0d62460
move resources again
clagomess Mar 12, 2024
89ad3ec
add maven wrapper
clagomess Mar 12, 2024
3e8bc91
add jenkins pipeline
clagomess Mar 13, 2024
437ca6f
unix like
clagomess Mar 13, 2024
cf9819d
unix like
clagomess Mar 13, 2024
0229728
fix Jenkinsfile artifact
clagomess Mar 13, 2024
52020dc
silent unit
clagomess Mar 13, 2024
b1ccdef
fix project Master equals source
clagomess Mar 13, 2024
4dc58e2
removed false todo
clagomess Mar 13, 2024
d2ad279
add favicon
clagomess Mar 14, 2024
4dec396
update doc
clagomess Mar 14, 2024
a756355
update doc
clagomess Mar 14, 2024
ce6d891
add feature exception
clagomess Mar 14, 2024
b0489a1
fix artifacts
clagomess Mar 14, 2024
7ffa808
fix unit; add TODO
clagomess Mar 14, 2024
39cae2f
fix branch
clagomess Mar 14, 2024
cedbd34
fix error when empty string
clagomess Mar 14, 2024
b5c4351
organize maven
clagomess Mar 15, 2024
4ad7f97
fix charset build
clagomess Mar 15, 2024
3c22931
wip load properties: impl color and file
clagomess Mar 15, 2024
40ec229
wip load properties: impl radio
clagomess Mar 15, 2024
db9a8c2
wip load properties: impl tab
clagomess Mar 15, 2024
9fd4695
add TODO
clagomess Mar 15, 2024
7916a14
theming
clagomess Mar 15, 2024
3ea069a
fix resources
clagomess Mar 15, 2024
6bcebbf
add todo; fix theme location; fix cli build
clagomess Mar 15, 2024
db5aa88
impl buffered base64 parser
clagomess Mar 16, 2024
c264521
impl buffered write format
clagomess Mar 16, 2024
9fc31f3
remove String.format to reduce heap usage
clagomess Mar 16, 2024
b2c0e3b
try new approach replace
clagomess Mar 16, 2024
dcf66bd
update dep; set new approach
clagomess Mar 17, 2024
5c30a83
update lombok dep; fix imports;
clagomess Mar 17, 2024
46ad488
better assert error
clagomess Mar 17, 2024
a6d85d6
fix panel toggle
clagomess Mar 17, 2024
9245507
fix methods name
clagomess Mar 17, 2024
918d06a
update dep
clagomess Mar 17, 2024
ffdfa5e
add some singleton
clagomess Mar 17, 2024
8bbac04
fix typo
clagomess Mar 17, 2024
7abf3a2
core: logo is a project file
clagomess Mar 17, 2024
e36c992
wip ProjectLogoChooserComponent; add disabled behavior in form compon…
clagomess Mar 17, 2024
1cfe85e
wip combo image logo chooser
clagomess Mar 30, 2024
718bb22
project.logo done
clagomess Apr 1, 2024
1045086
add revision info
clagomess Apr 1, 2024
591300b
update system screenshot
clagomess Apr 1, 2024
4145110
fix TODO
clagomess Apr 2, 2024
a09087c
remove html file append to PDF
clagomess Apr 2, 2024
d8f5d78
Fix #47 - large image width
clagomess Apr 2, 2024
b9ad607
mocked async change
clagomess Apr 2, 2024
ebc3bed
load properties cli
clagomess Apr 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.idea
*.iml
src/main/resources/htmlTemplate/node_modules
/target
target
Binary file added .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
18 changes: 18 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.5/apache-maven-3.9.5-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar
38 changes: 38 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
pipeline {
agent any

stages {
stage('Clean') {
steps {
cleanWs()
}
}
stage('Clone') {
steps {
git branch: 'master', url: 'https://github.com/clagomess/pirilampo.git'
}
}
stage('Build') {
steps {
sh '''docker run --rm \
-v ~/.m2:/root/.m2 \
-v .:/opt/pirilampo \
-w /opt/pirilampo \
amazoncorretto:8 /bin/bash ./mvnw clean compile package
'''
}
post {
success {
archiveArtifacts '**/target/*-jar-with-dependencies.jar,**/target/*.exe'
}
}
}
}

post {
always {
sh "sudo chown -R jenkins:jenkins ."
junit allowEmptyResults: true, skipMarkingBuildUnstable: true, testResults: '**/target/surefire-reports/*.xml'
}
}
}
83 changes: 63 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,89 @@
<p align="center">
<img src="https://raw.githubusercontent.com/clagomess/pirilampo/master/src/main/resources/img_01.png" width="64">
<img src="https://raw.githubusercontent.com/clagomess/pirilampo/master/gui/src/main/resources/favicon.svg" width="64" alt="Logo">
</p>

<p align="center">
<a href="https://github.com/clagomess/pirilampo/releases/latest"><img src="https://img.shields.io/github/release/clagomess/pirilampo.svg?maxAge=2592000" alt="GitHub Release"></a>
<a href="https://github.com/clagomess/pirilampo/actions"><img src="https://img.shields.io/github/workflow/status/clagomess/pirilampo/Java CI" alt="GitHub Workflow"></a>
<a href="https://github.com/clagomess/pirilampo/releases/latest">
<img src="https://img.shields.io/github/release/clagomess/pirilampo.svg?maxAge=2592000" alt="GitHub Release">
</a>
</p>

## Sobre
Pirilampo é um sistema gerador de documentação com base features escritos na linguagem Gherkin ([Cucumber](https://cucumber.io/docs/reference)) e com suporte a markedown ([CommonMark](http://commonmark.org/)).
# Pirilampo

The open source living documentation generator of features files writen in
[Gherkin](https://cucumber.io/docs/gherkin/reference/) and Markdown support.

## Installation
- Java JRE >= 8
- Check: [All releases](https://github.com/clagomess/pirilampo/releases/latest)

| Platform | Download |
|----------------------|--------------------------------------------------------------------------------------------------------------------|
| Windows x64 | [pirilampo-gui-2.0.0.exe](https://github.com/clagomess/pirilampo/releases/download/v2.0.0/pirilampo-gui-2.0.0.exe) |
| Any (Executable JAR) | [pirilampo-gui-2.0.0.jar](https://github.com/clagomess/pirilampo/releases/download/v2.0.0/pirilampo-gui-2.0.0.jar) |
| CLI | [pirilampo-cli-2.0.0.jar](https://github.com/clagomess/pirilampo/releases/download/v2.0.0/pirilampo-cli-2.0.0.jar) |

## GUI running

## Instalação
- Java JRE 8
- Download: <a href="https://github.com/clagomess/pirilampo/releases/latest">https://github.com/clagomess/pirilampo/releases/latest</a>

## Imagem do Sistema
<img src="https://raw.githubusercontent.com/clagomess/pirilampo/master/readme_assets/img_01.png" width="400">

## Exemplos
### Estrutura de pasta

## CLI

```
java -jar pirilampo-cli-*.jar -projectSource /foo/bar/features
```

Available options:

| Option | Description |
|---------------------|------------------------------------------------------------------------------------|
| compilationType | Compilation Type. Expected values: [FOLDER, FOLDER_DIFF, FEATURE]. Default: FOLDER |
| compilationArtifact | Compilation Artifact. Expected values: [HTML, PDF]. Default: HTML |
| projectSource | Folder or *.feature |
| projectMasterSource | Folder to compare |
| projectTarget | Target Folder |
| projectName | Project Name. Default: Pirilampo |
| projectVersion | Project Version. Default: 1.0 |
| projectLogo | Image file for logo |
| menuColor | Menu Color. Default: #14171A |
| menuTextColor | Menu Text Color. Default: #DDDDDD |
| htmlPanelToggle | Panel Toggle. Expected values: [CLOSED, OPENED]. Default: OPENED |
| disableEmbedImages | Disable Emded Images? |
| layoutPdf | Layout PDF. Expected values: [PORTRAIT,LANDSCAPE]. Default: PORTRAIT |

## Sample
### Folder structure
See at [doc_exemplo](https://github.com/clagomess/pirilampo/tree/new-pirilampo/readme_assets/doc_exemplo)
```
doc_exemplo/
├── feature/
│ └── Independência do Brasil/
│ └── 001 - Introdução.feature
│ └── 320px-Independence_of_Brazil_1888.jpg
└── html/
```

#### Feature: 001 - Introdução.feature
### Feature: 001 - Introdução.feature
```feature
# language: pt
# encoding: utf-8
Funcionalidade: Introdução
**Independência do Brasil** é um processo que se estende de 1821 a 1825 e coloca em violenta oposição o [Reino do Brasil](https://pt.wikipedia.org/wiki/Reino_do_Brasil) e o Reino de Portugal, dentro do Reino Unido de Portugal, Brasil e Algarves. As Cortes Gerais e Extraordinárias da Nação Portuguesa, instaladas em 1820, como uma consequência da Revolução Liberal do Porto, tomam decisões, a partir de 1821, que tinham como objetivo reduzir novamente o Brasil ao seu antigo estatuto colonial.
**Independência do Brasil** é um processo que se estende de 1821 a 1825 e coloca em violenta oposição
o [Reino do Brasil](https://pt.wikipedia.org/wiki/Reino_do_Brasil) e o Reino de Portugal, dentro do Reino Unido de
Portugal, Brasil e Algarves. As Cortes Gerais e Extraordinárias da Nação Portuguesa, instaladas em 1820,
como uma consequência da Revolução Liberal do Porto, tomam decisões, a partir de 1821, que tinham como objetivo
reduzir novamente o Brasil ao seu antigo estatuto colonial.

Contexto:
Dado Antecedendo o processo de independência do Brasil, mas com fortes influências sobre o mesmo, ocorre a transferência da corte portuguesa para o Brasil.
Dado Antecedendo o processo de independência do Brasil, mas com fortes influências sobre o mesmo, ocorre a transferência da corte portuguesa para o Brasil.

| Proclamação da Independência |
| ![Image](https://upload.wikimedia.org/wikipedia/commons/thumb/4/40/Independence_of_Brazil_1888.jpg/320px-Independence_of_Brazil_1888.jpg) |
| Proclamação da Independência |
| ![Image](320px-Independence_of_Brazil_1888.jpg) |
```

Html Individual | Html Múltiplas Feature | PDF Feature
--------------- | ---------------------- | -----------
![a](https://raw.githubusercontent.com/clagomess/pirilampo/master/readme_assets/img_02.png) | ![b](https://raw.githubusercontent.com/clagomess/pirilampo/master/readme_assets/img_03.png) | ![c](https://raw.githubusercontent.com/clagomess/pirilampo/master/readme_assets/img_04.png)
### Compilation type/artifact

| Feature/HTML | Folder/HTML | Feature/PDF |
|---------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------|
| ![a](https://raw.githubusercontent.com/clagomess/pirilampo/master/readme_assets/img_02.png) | ![b](https://raw.githubusercontent.com/clagomess/pirilampo/master/readme_assets/img_03.png) | ![c](https://raw.githubusercontent.com/clagomess/pirilampo/master/readme_assets/img_04.png) |
57 changes: 57 additions & 0 deletions cli/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.github.clagomess.pirilampo</groupId>
<artifactId>pirilampo-parent</artifactId>
<version>2.0.0</version>
</parent>

<artifactId>pirilampo-cli</artifactId>

<properties>
<project.mainclass>com.github.clagomess.pirilampo.cli.Main</project.mainclass>
</properties>

<dependencies>
<dependency>
<groupId>com.github.clagomess.pirilampo</groupId>
<artifactId>pirilampo-core</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.5.0</version>
</dependency>

<dependency>
<groupId>com.ginsberg</groupId>
<artifactId>junit5-system-exit</artifactId>
<version>1.1.2</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
57 changes: 57 additions & 0 deletions cli/src/main/java/com/github/clagomess/pirilampo/cli/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package com.github.clagomess.pirilampo.cli;

import com.github.clagomess.pirilampo.core.compilers.*;
import com.github.clagomess.pirilampo.core.dto.ParametersDto;
import com.github.clagomess.pirilampo.core.util.RevisionUtil;
import lombok.extern.slf4j.Slf4j;

import java.util.Arrays;

import static com.github.clagomess.pirilampo.core.enums.CompilationArtifactEnum.HTML;
import static com.github.clagomess.pirilampo.core.enums.CompilationArtifactEnum.PDF;
import static com.github.clagomess.pirilampo.core.enums.CompilationTypeEnum.*;

@Slf4j
public class Main {
private static final MainOptions mainOptions = new MainOptions();
private static final PropertiesCompiler propertiesCompiler = new PropertiesCompiler();

public static void main(String[] args) {
log.info(RevisionUtil.getInstance().toString());

try {
ParametersDto parameters = mainOptions.getArgs(args);

propertiesCompiler.loadData(parameters);

if (parameters.getCompilationType() == FEATURE &&
parameters.getCompilationArtifact() == HTML
) {
new FeatureToHTMLCompiler(parameters).build();
}

if (parameters.getCompilationType() == FEATURE &&
parameters.getCompilationArtifact() == PDF
) {
new FeatureToPDFCompiler(parameters).build();
}

if (Arrays.asList(FOLDER, FOLDER_DIFF).contains(parameters.getCompilationType()) &&
parameters.getCompilationArtifact() == HTML
) {
new FolderToHTMLCompiler(parameters).build();
}

if (parameters.getCompilationType() == FOLDER &&
parameters.getCompilationArtifact() == PDF
) {
new FolderToPDFCompiler(parameters).build();
}

System.exit(0);
} catch (Throwable e) {
log.error(log.getName(), e);
System.exit(1);
}
}
}
Loading
Loading