Skip to content

Commit

Permalink
Rework docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jmini committed Dec 5, 2017
1 parent 3e52234 commit 3c49965
Show file tree
Hide file tree
Showing 29 changed files with 436 additions and 145 deletions.
17 changes: 17 additions & 0 deletions docs/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>docs</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
</natures>
</projectDescription>
1 change: 1 addition & 0 deletions docs/gh-pages_pages.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
index.html
163 changes: 163 additions & 0 deletions docs/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.wdev91.eclipse.copyright</groupId>
<artifactId>docs</artifactId>
<version>1.5.2</version>
<packaging>pom</packaging>

<pluginRepositories>
<pluginRepository>
<id>bintray.jmini.maven</id>
<url>http://dl.bintray.com/jmini/maven/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<asciidoctor.maven.plugin.version>1.5.3</asciidoctor.maven.plugin.version>
<asciidoctorj.version>1.5.4</asciidoctorj.version>
<asciidoctorj.gh-edit.version>3.0.0</asciidoctorj.gh-edit.version>
<jruby.version>9.0.5.0</jruby.version>
<github.global.server>github</github.global.server> <!-- this should match the sever id in your settings.xml -->
<!-- The project URL on GitHub is : https://github.com/${github.repository.owner}/${github.repository.name} -->
<github.repository.owner>jmini</github.repository.owner>
<github.repository.name>Eclipse-Copyright-Generator</github.repository.name>
<commit.message>Update the 'gh-pages' branch.</commit.message>
</properties>

<build>
<plugins>

<!-- Run AsciidoctorJ -->
<plugin>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-maven-plugin</artifactId>
<version>${asciidoctor.maven.plugin.version}</version>
<dependencies>
<dependency>
<groupId>org.jruby</groupId>
<artifactId>jruby-complete</artifactId>
<version>${jruby.version}</version>
</dependency>
<dependency>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctorj</artifactId>
<version>${asciidoctorj.version}</version>
</dependency>
<dependency>
<groupId>com.bsiag.asciidoctorj</groupId>
<artifactId>gh-edit</artifactId>
<version>${asciidoctorj.gh-edit.version}</version>
</dependency>
</dependencies>
<configuration>
<sourceDirectory>src</sourceDirectory>
<backend>html5</backend>
<sourceHighlighter>coderay</sourceHighlighter>
<attributes>
<icons>font</icons>
<sectanchors>true</sectanchors>
<idprefix/>
<idseparator>-</idseparator>
<imagesdir/>
<docinfo1>true</docinfo1>
<toc>left</toc>
<toclevels>3</toclevels>
<sourcedir>${project.build.sourceDirectory}</sourcedir>
<project-version>${project.version}</project-version>
<last-released-version>${project.version}</last-released-version>
</attributes>
</configuration>
<executions>
<execution>
<id>asciidoc-to-html</id>
<phase>generate-resources</phase>
<goals>
<goal>process-asciidoc</goal>
</goals>
</execution>
</executions>
</plugin>

<!-- prepare index for github pages -->
<plugin>
<groupId>com.bsiag.htmltools</groupId>
<artifactId>htmltools-maven-plugin</artifactId>
<version>1.1.4</version>
<executions>
<execution>
<phase>process-resources</phase>
<goals>
<goal>htmltools</goal>
</goals>
<configuration>
<outputFolder>${project.build.directory}/gh-pages-docs</outputFolder>
<pagesListFile>../eclipse_help/help-pages.txt</pagesListFile>
<inputSources>
<inputSource>
<inputFolder>${project.build.directory}/generated-docs</inputFolder>
<fixExternalLinks>false</fixExternalLinks>
<fixXrefLinks>false</fixXrefLinks>
<htmlOutput>
<pagesListFile>${project.basedir}/gh-pages_pages.txt</pagesListFile>
</htmlOutput>
</inputSource>
</inputSources>
</configuration>
</execution>
</executions>
</plugin>

<!-- Commit and push site to github pages, by default to gh-pages branch -->
<!-- https://github.com/github/maven-plugins -->
<plugin>
<groupId>com.github.github</groupId>
<artifactId>site-maven-plugin</artifactId>
<version>0.12</version>
<configuration>
<message>${commit.message}</message>
<outputDirectory>${project.build.directory}/gh-pages-docs</outputDirectory>
<repositoryName>${github.repository.name}</repositoryName>
<repositoryOwner>${github.repository.owner}</repositoryOwner>
<dryRun>false</dryRun>
<excludes>
<exclude>**/*.jsp</exclude>
<exclude>**/web.xml</exclude>
</excludes>
</configuration>
<executions>
<execution>
<goals>
<goal>site</goal>
</goals>
<phase>site</phase>
</execution>
</executions>
</plugin>

<!-- Run mvn exec:exec to generate site and upload it with single step -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<executable>mvn</executable>
<arguments>
<argument>clean:clean</argument>
<argument>asciidoctor:process-asciidoc</argument>
<argument>site:site</argument>
<argument>clean:clean</argument>
</arguments>
</configuration>
</plugin>
</plugins>
</build>
</project>
Binary file added docs/src/config02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/config03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/config04.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/config05.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/guide04.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/guide05.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/guide06.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/guide09.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/guide10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/guide11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/guide20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/guide21.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 5 additions & 23 deletions docs/index.adoc → docs/src/index.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
:experimental:
:github-readme: ../README.adoc
:github-readme: ../../README.adoc

include::{github-readme}[tags=vardef]

Expand Down Expand Up @@ -36,32 +36,14 @@ image::install.png[Install New Software windows]

=== Usage

==== Project menu
include::wizard.adoc[leveloffset="+2"]

Open the "menu:Project[Apply copyright...]" menu.
include::prefs_project.adoc[leveloffset="+2"]

image::menu.png[Apply copyright menu]
include::prefs_copyright.adoc[leveloffset="+2"]

include::prefs_formats.adoc[leveloffset="+2"]

==== Step 1

In the first step, you select the projects where you want to add the copyright headers.

image::step1.png[Wizard Step 1]


==== Step 2

In the second step, you can select the license notice you want to apply.

image::step2.png[Wizard Step 2]


==== Step 3

In the third step, you can select precisely which files will be modified.

image::step3.png[Wizard Step 3]


include::{github-readme}[tags=contact-section]
Expand Down
File renamed without changes
File renamed without changes
70 changes: 70 additions & 0 deletions docs/src/prefs_copyright.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
== Copyright preference page

The Copyright parameters allows one to define a set of standard licenses, including the text to be placed in the comment header of files, as well as a license file to add to the projects.


image::config02.png[]

[cols="2*", options="header"]
|===

|Parameter
|Description

|Owner
|Sets the value of the substitution variable `${owner}`. If not defined, it will take by default the same value that `${user}` variable.

|Licenses
|List of pre-configured licenses. Selecting an item on this list updates the fields in tabs.

|Header text
|Tab to define the text of the comment to be placed in the header of files. This text may contain substitution variables, which will be replaced by their values at the time of insertion of the comment in each target file. The text of the comment is defined line by line. It should not contain comment format characters specific to a file type (eg. `/* */`).

The usable substitution variables are:

`${owner}` - Value of the owner parameter

`${user}` - The OS user name

`${year}` - The current year

`${file_name}` - Name of the file on which the header is applied

`${file_absolute_path}` - Absolute path of the file on which the header is applied

`${file_path}` - Path of the file on which the header is applied, relative to the project root

`${project_name}` - Name of the project containing the file on which the header is applied



|License file
|Tab to set the (optional) license file to add to the projects.
|===

The *License file* tab allows you to associate a license file to a copyright definition:

image:config03.png[]

[cols="2*", options="header"]
|===

|Parameter
|Description

|File name
|Default name of the license file. The file name may be changed if desired by the user within the parameters of the wizard.

|File content
|Text of the license. If the wanted file format is formatted, such as HTML, the text must contain all the formatting tags. The contents of the file is not interpreted, so the substitution variables do not apply here.
|===
The plugin is preconfigured with headers and licenses files for several open source licenses: Apache, Boost, BSD, (A)GPL, LGPL, MIT, and Mozilla. It is possible to add, change or delete any copyrights with the buttons Add, Modify, and Delete:

* Add - Add a new Copyright. A dialog box opens for the input of the label text under which the Copyright will be registered.
+
image:config04.png[]
* Modify - Changing the label text of the copyright selected from the list.
* Delete - Remove the copyright selected from the list.
The *'Restore Defaults'* button will reload the default copyrights configuration file provided with the plug-in. All custom texts and copyrights will be lost.

56 changes: 56 additions & 0 deletions docs/src/prefs_formats.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
:plus: +

== Headers formats preference page

The Header formats parameters are used to define the applicable format of comment on headers for different types of files.
The recognition of the type of file is based on the Eclipse ContentType.

The formats apply only on the content in text format.
If a format is not set on a ContentType, it inherits the format of its parent, and so on recursively until basic type Text.

image::config05.png[]

To define a particular format on a file type, select the correspondent ContentType in the tree, and enter the definition of the format:

[cols="2*", options="header"]
|===

|Parameter
|Description

|Exclude this type from copyrights
|If checked, all files defined by this ContentType will be automatically excluded by the wizard and will not have a copyright header. All other fields are then disabled.

|First line
|Format of the first line of the comment header. Typically this line contains no text and is composed of characters to draw a dividing line.

|Line prefix
|Format for the beginning of a comment line. This string will be placed by concatenation before all the lines of comment text defined in a text of copyrigt header, including blank lines.

|Last line
|Format of the last line of the comment header. Typically this line contains no text and is composed of characters to draw a dividing line.

|Line format comment
|Flag indicating if the comment header is in line format (checked) or block format (unchecked). For a comment in line format, it is important to define a valid "Line prefix" for the target language.

|Do not override the first line
|Flag indicating whether, when inserting a comment in a file of the selected type, the comment must begin on the first line (unchecked) or on the second line (checked).

Some languages require an instruction or a comment of a particular format on the first line of a source file.
When checked, the content of the first line will be preserved by the wizard.

|First line pattern
|Regular expression pattern to apply on the first line.
If the line matches, the comment is inserted after the line, otherwise it is inserted before.
This pattern is optional. If it is left empty, the first line is always skipped before to insert the comment header.

The regular expression must respect the syntax defined by the Pattern java class.
|===
The labels to the right of the text entry fields indicate the length of the current content of the fields. These labels are particularly useful for long lines and lines containing spaces at the end.

The *Clear* button erases completely the format definition of the selected ContentType. It then inherits the format of its parent.

The *'Restore Defaults'* button will reload the default formats definitions provided with the plug-in.
All custom formats will be lost.
By default the plug-in defines formats for 'Text', 'C Source File', 'C Header File' , 'C{plus}{plus} Source File' 'C{plus}{plus} Header File', 'Java Source File' and 'XML' content types, and excludes 'JAR Manifest File', 'ANT buildfile' and all content types defined by PDE and WTP plug-ins.

21 changes: 21 additions & 0 deletions docs/src/prefs_project.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
== Project copyright properties page

Copyright settings can be defined at the level of each project too, in the project properties. When defined, those settings are applied by default by the copyright wizard.

To define project settings, open the project properties dialog and select the Copyright category. The properties page displayed contains two tabs.


image::guide20.png[]

Copyright settings are disabled by default. To enable, select the *'Enable project specific settings'* checkbox. When enabled, a popup message is displayed proposing to import in the project settings the header formats definitions of the workspace. If you respond No, you will have to define all the header format, including the root Text content type.


image::guide21.png[]

When project settings are selected, the two tabs are enabled:

* *Header text*- The first tab allows one to define the header text that will be used by default for all the files in the project on which the wizard will apply a copyright. The same substitution variables that are in workspace preferences can be used here.
* *Header formats*- The second tab allows one to define the header comment format for all the content types deriving of the root Text type. This tab works exactly as the workspace preferences one.
The project copyright settings are saved in a file stored in the .settings directory of the project. Then this file can be saved in a SCM tool like CVS or Subversion and shared by a team.

Binary file added docs/src/step1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/step2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/step3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 3c49965

Please sign in to comment.