Permalink
Browse files

Remove trailing whitespace from docs. (PR #214)

* Remove trailing whitespace
* Fail CI build on trailing whitespace
* Add a basic .editorconfig file
  • Loading branch information...
1 parent a86c61d commit 3e4d94802ee0b4960e6cf1965ce634f3a6549fdd @bk2204 bk2204 committed with mojavelinux Dec 26, 2016
Showing with 186 additions and 163 deletions.
  1. +9 −0 .editorconfig
  2. +1 −1 README.adoc
  3. +14 −0 Rakefile
  4. +2 −2 docs/_includes/asciidoctor-ant.adoc
  5. +2 −2 docs/_includes/attr-use.adoc
  6. +6 −6 docs/_includes/attrs-builtin.adoc
  7. +9 −9 docs/_includes/attrs-env.adoc
  8. +1 −1 docs/_includes/command-line-usage.adoc
  9. +1 −1 docs/_includes/counter.adoc
  10. +2 −2 docs/_includes/docinfo.adoc
  11. +19 −19 docs/_includes/ex-table.adoc
  12. +1 −1 docs/_includes/html-ruby-api.adoc
  13. +1 −1 docs/_includes/image-sizing.adoc
  14. +3 −3 docs/_includes/language-support.adoc
  15. +1 −1 docs/_includes/manpage.adoc
  16. +4 −4 docs/_includes/messages.adoc
  17. +1 −1 docs/_includes/multi-special-ex.adoc
  18. +1 −1 docs/_includes/project-author.adoc
  19. +1 −1 docs/_includes/project-lic.adoc
  20. +3 −3 docs/_includes/ruby-api-options.adoc
  21. +6 −6 docs/_includes/secure.adoc
  22. +1 −1 docs/_includes/subs-symbol-repl.adoc
  23. +6 −6 docs/_includes/templates-api.adoc
  24. +1 −1 docs/_includes/troubleshoot.adoc
  25. +3 −3 docs/_includes/ts-block-render.adoc
  26. +1 −1 docs/_includes/uri-include.adoc
  27. +3 −3 docs/asciidoc-asciidoctor-diffs.adoc
  28. +3 −3 docs/asciidoclet.adoc
  29. +4 −4 docs/asciidoctor-maven-plugin.adoc
  30. +3 −3 docs/asciidoctorj.adoc
  31. +1 −1 docs/convert-asciidoc-to-pdf.adoc
  32. +3 −3 docs/faq.adoc
  33. +5 −5 docs/hack-asciidoctor-maven-plugin.adoc
  34. +1 −1 docs/index.adoc
  35. +1 −1 docs/install-and-use-asciidoctorjs.adoc
  36. +3 −3 docs/install-and-use-deckjs-backend.adoc
  37. +2 −2 docs/install-asciidoctor-osx.adoc
  38. +1 −1 docs/what-is-asciidoc.adoc
  39. +13 −13 docs/what-is-asciidoctor.adoc
  40. +2 −2 index.adoc
  41. +1 −1 news/asciidoclet-1.5.0-released.adoc
  42. +22 −22 news/asciidoctor-0-1-3-released.adoc
  43. +7 −7 news/asciidoctor-0-1-4-released.adoc
  44. +2 −2 news/asciidoctor-java-integration-0-1-2-1-released.adoc
  45. +4 −4 news/asciidoctor-java-integration-0-1-3-released.adoc
  46. +1 −1 news/asciidoctor-maven-plugin-0-1-3-released.adoc
  47. +1 −1 news/enjoy-the-magic-of-asciidoctor-in-java.adoc
  48. +3 −3 news/oscon-2013-docs-workshop-preview.adoc
View
@@ -0,0 +1,9 @@
+[*]
+charset = utf-8
+end_of_line = lf
+
+[*.adoc]
+indent_size = 2
+indent_style = space
+insert_final_newline = true
+trim_trailing_whitespace = true
View
@@ -96,7 +96,7 @@ First, install http://rvm.io[RVM]. Trust me on this.
Next, setup an RVM gemset for working with the Asciidoctor site:
- $ rvm use 2.3.3@asciidoctor.org --create
+ $ rvm use 2.3.3@asciidoctor.org --create
At this point, you could install Awestruct directly, but since the site build has some additional dependencies, it's best to let bundler handle the installation. Bundler will also ensure that you are using the correct versions of each gem when you run Awestruct.
View
@@ -125,6 +125,9 @@ desc 'Generate site from Travis CI and, if not a pull request, publish site to p
task :travis do
# force use of bundle exec in Travis environment
$use_bundle_exec = true
+
+ reject_trailing_whitespace
+
# if this is a pull request, do a simple build of the site and stop
if ENV['TRAVIS_PULL_REQUEST'].to_s.to_i > 0
msg 'Pull request detected. Executing build only.'
@@ -365,3 +368,14 @@ def set_pub_dates(branch)
end
end
end
+
+def reject_trailing_whitespace
+ Dir['**/*.adoc'].each do |file|
+ # Don't check external gems.
+ next if file =~ /^vendor\//
+ IO.readlines(file).each_with_index do |ln, i|
+ ln.chomp!
+ raise "#{file} contains trailing whitespace on line #{i + 1}" if ln =~ /\s+\Z/
+ end
+ end
+end
@@ -10,8 +10,8 @@ Usage is:
<project xmlns:asciidoctor="antlib:org.asciidoctor.ant">
...
<target name="doc">
- <taskdef uri="antlib:org.asciidoctor.ant"
- resource="org/asciidoctor/ant/antlib.xml"
+ <taskdef uri="antlib:org.asciidoctor.ant"
+ resource="org/asciidoctor/ant/antlib.xml"
classpath="lib/asciidoctor-ant.jar"/>
<asciidoctor:convert sourceDirectory="src/asciidoc" outputDirectory="target"/>
</target>
@@ -16,7 +16,7 @@ For example:
Many attributes can be assigned a value at the same time:
:leveloffset: 3
-
+
The value may be empty, a string (of characters) or a number.
A string value may include references to other attributes.
@@ -38,7 +38,7 @@ An [.term]_attribute reference_ is an inline element composed of the name of the
For example:
The value of leveloffset is {leveloffset}.
-
+
The attribute reference is replaced by the attribute's value when Asciidoctor processes the document.
Referencing an attribute that is not set is considered an error and is handled specially by the processor.
@@ -60,7 +60,7 @@ See <<migrating-from-asciidoc-python>> if you are updating an older document.
|<<migrating-from-asciidoc-python>>
|experimental
-|Enable experimental extensions.
+|Enable experimental extensions.
The features behind this attribute are subject to change and may even be removed in a future version.
Currently enables the UI macros (button, menu and kbd).
|_not set_
@@ -172,7 +172,7 @@ Unsetting it will remove the label and time from the footer.
|<<user-preface>>
|table-caption
-|Text of the label that is automatically prefixed to table titles.
+|Text of the label that is automatically prefixed to table titles.
To turn off table caption labels and numbers, add the `table-caption` attribute to the document header with an empty value.
|Table
|_any_
@@ -424,18 +424,18 @@ _Since this is a reserved attribute that has special behavior, you should avoid
|<<subtitle-partitioning>>
|toc
-|Switches the table of contents on, and defines its location.
+|Switches the table of contents on, and defines its location.
|_not set_
|auto, left, right, macro or preamble
|{y}
-|<<user-toc>>
+|<<user-toc>>
|toclevels
|Maximum section level to display.
|2
|1{endash}5
|{y}
-|<<user-toc>>
+|<<user-toc>>
// NOTE toc-placement moved to deprecated table in migration guide
//|toc-placement
@@ -929,6 +929,6 @@ Since attributes can reference other attributes, it would be possible to create
|====
^[1]^ The default value isn't necessarily the value you will get by entering `\{name}`.
-It may be the fallback value which Asciidoctor uses if the attribute is not defined.
+It may be the fallback value which Asciidoctor uses if the attribute is not defined.
The effect is the same either way.
// end::table[]
@@ -18,11 +18,11 @@ It's recommended that you treat these attributes as read only.
|===
|Attribute |Description |Example Value
-|asciidoctor
+|asciidoctor
|Set if the current processor is Asciidoctor.
|{asciidoctor}
-|asciidoctor-version
+|asciidoctor-version
|Asciidoctor version.
|{asciidoctor-version}
@@ -43,11 +43,11 @@ For example, if the backend is `docbook5`, the basebackend is `docbook`.
|Last modified date and time of the source document.^[1,2]^
|2015-01-04 19:26:06 GMT+0000
-|docdir
+|docdir
|Full path of the directory that contains the source document.
|/home/user/docs
-|docfile
+|docfile
|Full path of the source document.
|/home/user/docs/userguide.adoc
@@ -56,7 +56,7 @@ For example, if the backend is `docbook5`, the basebackend is `docbook`.
|userguide
|doctime
-|Last modified time of the source document.^[1,2]^
+|Last modified time of the source document.^[1,2]^
|19:26:06 GMT+0000
|doctype
@@ -67,27 +67,27 @@ For example, if the backend is `docbook5`, the basebackend is `docbook`.
|Set if content is being converted to an embeddable document (body only).
|
-|filetype
+|filetype
|File extension of the output file name (without leading period).
|html
|htmlsyntax
|Syntax used when generating the HTML output (html or xhtml).
|html
-|localdate
+|localdate
|Date when converted.^[2]^
|2016-02-17
|localdatetime
-|Date and time when converted.^[2]^
+|Date and time when converted.^[2]^
|2016-02-17 19:31:05 GMT+0000
|localtime
|Time when converted.^[2]^
|19:31:05 GMT+0000
-|outdir
+|outdir
|Full path of the output directory.
|/home/user/docs/dist
@@ -3,7 +3,7 @@ Command line usage quick start for Asciidoctor
This file is included in the install-toolchain and user-manual documents
////
-Asciidoctor's command line interface (CLI) is a drop-in replacement for the `asciidoc.py` command from the Python implementation.
+Asciidoctor's command line interface (CLI) is a drop-in replacement for the `asciidoc.py` command from the Python implementation.
If the Asciidoctor gem installed successfully, the `asciidoctor` command line interface (CLI) will be available on your PATH.
To confirm that Asciidoctor is available, execute:
@@ -24,7 +24,7 @@ To create a sequence starting at 1, use the simple form `+{counter:name}+` as sh
[source,asciidoc]
The salad calls for {counter:seq1}) apples, {counter:seq1}) oranges and {counter:seq1}) pears.
-
+
Here's the resulting output:
====
@@ -146,7 +146,7 @@ For example:
:docinfo: shared,private-footer
----
-This docinfo configuration will apply the shared docinfo head and footer files, if they exist, as well as the private footer file, if it exists.
+This docinfo configuration will apply the shared docinfo head and footer files, if they exist, as well as the private footer file, if it exists.
// NOTE migrate this NOTE to the migration guide once 1.6 is released
[NOTE]
@@ -179,7 +179,7 @@ If other AsciiDoc files are added to the same folder, and `docinfo` is set to `s
=== Locating docinfo files
-By default, docinfo files are searched for in the same folder as the document file.
+By default, docinfo files are searched for in the same folder as the document file.
If you want to keep them anywhere else, set the `docinfodir` attribute to their location:
[source,asciidoc]
@@ -5,7 +5,7 @@ Examples for table sections
// tag::base-co[]
|=== <1>
<2>
-| Cell in column 1, row 1 | Cell in column 2, row 1 <3>
+| Cell in column 1, row 1 | Cell in column 2, row 1 <3>
<4>
| Cell in column 1, row 2 | Cell in column 2, row 2
@@ -44,8 +44,8 @@ Examples for table sections
|Cell in column 2, row 1
|Cell in column 3, row 1
-|Cell in column 1, row 2
-|Cell in column 2, row 2
+|Cell in column 1, row 2
+|Cell in column 2, row 2
|Cell in column 3, row 2
|===
// end::base[]
@@ -106,10 +106,10 @@ Examples for table sections
// tag::same-indv[]
[cols="3*"]
|===
-|Cell in column 1, row 1 |Cell in column 2, row 1
+|Cell in column 1, row 1 |Cell in column 2, row 1
|Cell in column 3, row 1
-|Cell in column 1, row 2
+|Cell in column 1, row 2
|Cell in column 2, row 2 |Cell in column 3, row 2
|===
// end::same-indv[]
@@ -119,7 +119,7 @@ Examples for table sections
|Cell in column 1, row 1 |Cell in column 2, row 1
-|Cell in column 1, row 2
+|Cell in column 1, row 2
|Cell in column 2, row 2
|===
@@ -132,7 +132,7 @@ Examples for table sections
|Cell in column 1, row 1
|Cell in column 2, row 1
-|Cell in column 1, row 2
+|Cell in column 1, row 2
|Cell in column 2, row 2
|===
@@ -173,7 +173,7 @@ Examples for table sections
|Cell in column 1, row 1
|Cell in column 2, row 1
-|Cell in column 1, row 2
+|Cell in column 1, row 2
|Cell in column 2, row 2
|===
// end::opt-h[]
@@ -185,7 +185,7 @@ Examples for table sections
|Cell in column 1, row 1
|Cell in column 2, row 1
-|Cell in column 1, row 2
+|Cell in column 1, row 2
|Cell in column 2, row 2
|===
// end::impl-h[]
@@ -198,7 +198,7 @@ Examples for table sections
|Cell in column 1, row 1
|Cell in column 2, row 1
-|Cell in column 1, row 2
+|Cell in column 1, row 2
|Cell in column 2, row 2
|Footer in column 1, row 3
@@ -214,7 +214,7 @@ Examples for table sections
|Cell in column 2, row 1
|Cell in column 3, row 1
-|Cell in column 1, row 2
+|Cell in column 1, row 2
|Cell in column 2, row 2
|Cell in column 3, row 2
|===
@@ -229,7 +229,7 @@ Examples for table sections
|Cell in column 2, row 1
|Cell in column 3, row 1
-|Cell in column 1, row 2
+|Cell in column 1, row 2
|Cell in column 2, row 2
|Cell in column 3, row 2
|===
@@ -244,7 +244,7 @@ Examples for table sections
|Cell in column 2, row 1
|Cell in column 3, row 1
-|Cell in column 1, row 2
+|Cell in column 1, row 2
|Cell in column 2, row 2
|Cell in column 3, row 2
|===
@@ -253,27 +253,27 @@ Examples for table sections
// tag::b-col-h-co[]
[cols="2*", options="header"] <1>
|===
-|Name of Column 1
-|Name of Column 2
+|Name of Column 1
+|Name of Column 2
|Cell in column 1, row 1
|Cell in column 2, row 1
-|Cell in column 1, row 2
+|Cell in column 1, row 2
|Cell in column 2, row 2
|===
// end::b-col-h-co[]
// tag::b-col-h[]
[cols="2*", options="header"]
|===
-|Name of Column 1
-|Name of Column 2
+|Name of Column 1
+|Name of Column 2
|Cell in column 1, row 1
|Cell in column 2, row 1
-|Cell in column 1, row 2
+|Cell in column 1, row 2
|Cell in column 2, row 2
|===
// end::b-col-h[]
@@ -4,7 +4,7 @@ HTML output section
== Using the Ruby API
This document is included in render-documents and the user-manual.
-TODO: expand this section
+TODO: expand this section
////
Asciidoctor also includes a Ruby API that lets you generate an HTML document directly from a Ruby application.
@@ -102,7 +102,7 @@ DocBook also accepts the `width` attribute if `scaledwidth` is not provided.
|docbook
|scaledwidth=100mm +
-(or cm, em, in, pc, pt, px)
+(or cm, em, in, pc, pt, px)
|scale=80
|scaledwidth=50%
|Not possible
Oops, something went wrong.

0 comments on commit 3e4d948

Please sign in to comment.