github.com/xml-comp/xml-comp@v0.0.42-0.20180719122048-292fe466b944/README.md (about)

     1  [![LICENSE](https://img.shields.io/badge/license-MIT-orange.svg)](LICENSE)
     2  [![GoDoc](https://godoc.org/github.com/XML-Comp/XML-Comp?status.png)](https://godoc.org/github.com/XML-Comp/XML-Comp)
     3  [![Go Report Card](https://goreportcard.com/badge/github.com/XML-Comp/XML-Comp)](https://goreportcard.com/report/github.com/XML-Comp/XML-Comp)
     4  [![codebeat badge](https://codebeat.co/badges/1600adbb-27a3-4c3b-803e-818e1834b51a)](https://codebeat.co/projects/github-com-xml-comp-xml-comp)
     5  
     6  
     7  [![Top Level Coverage](https://coveralls.io/repos/github/XML-Comp/XML-Comp/badge.svg?branch=master)](https://coveralls.io/github/XML-Comp/XML-Comp?branch=master)
     8  [![Travis Build Status](https://api.travis-ci.org/XML-Comp/XML-Comp.svg?branch=master)](https://travis-ci.org/XML-Comp/XML-Comp)
     9  [![DOI](https://zenodo.org/badge/71943139.svg)](https://zenodo.org/badge/latestdoi/71943139)
    10  
    11  
    12  ![Awesome](https://raw.githubusercontent.com/istio/fortio/master/docs/mentioned-badge.svg?sanitize=true)
    13  
    14  [![Donate](https://www.paypalobjects.com/pt_BR/BR/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=arxdsilva%40gmail%2ecom&lc=BR&item_name=xml%2dcomp&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted)
    15  
    16  
    17  ## Menu
    18  1. [What is XML-Comp?](https://github.com/xml-comp/xml-comp#what-is-XML-Comp)
    19  2. [Features](https://github.com/xml-comp/xml-comp#features)
    20  3. [Installing](https://github.com/xml-comp/xml-comp#installing)
    21  4. [Running](https://github.com/xml-comp/xml-comp#running)
    22  5. [How this works?](https://github.com/xml-comp/xml-comp#how-this-works)
    23  6. [Comparing any kind of document](https://github.com/xml-comp/xml-comp#comparing-any-kind-of-document)
    24  7. [Contributing](https://github.com/xml-comp/xml-comp#contributing)
    25  8. [To Do](https://github.com/xml-comp/xml-comp#to-do---check-our-issues--milestones)
    26  9. [Using only the comparer package](https://github.com/xml-comp/xml-comp#using-only-the-comparer-package)
    27  
    28  ## What is XML-Comp
    29  This is a command line tool and a package that together they provide the capability of comparing two directories and appending to files the differences between the directories, also creates possible files or folders that are missing. It was made to help [RimWorld](http://rimworldgame.com/)'s [community translators](https://github.com/ludeon)(1) to know what was modified on the last XML updates and to let them keep in track of what they need to add/remove from what has been done.
    30  
    31  (1) and maybe other indie games that uses XML
    32  
    33  ### Features
    34  - [x] [Compare two given directories](https://github.com/XML-Comp/XML-Comp/issues/7)
    35  - [x] [Append missing tags to the respective file](https://github.com/XML-Comp/XML-Comp/issues/8)
    36  - [x] [Creates missing files on the compared directory](https://github.com/XML-Comp/XML-Comp/issues/9)
    37  - [x] [Creates missing folders on the compared directory](https://github.com/XML-Comp/XML-Comp/issues/32)
    38  - [x] [Compare one directory with multiple directories](https://github.com/XML-Comp/XML-Comp/issues/48)
    39  - [x] [Compare automatically the game's english version with the given translation](https://github.com/XML-Comp/XML-Comp/issues?q=is%3Aissue+is%3Aclosed)
    40  - [ ] Translate tag content
    41  - [ ] Expose untracked files
    42  - [ ] Expose untracked directories
    43  - [ ] Expose untracked tags
    44  
    45  ### Installing
    46  ```
    47  $ go get github.com/XML-Comp/XML-Comp
    48  ```
    49  
    50  ### Running
    51  ```shell
    52  $ XML-Comp -translation /path/to/language/translation
    53  ```
    54  
    55  ### How this works?
    56  You need the path that is called "translation", which are described bellow:
    57  - **`"translation"`**: Full path directory of your RimWorld ~Language~ folder cloned from [GitHub](https://github.com/ludeon).
    58  
    59  My "translation" path: **`/Users/arthur/Github/RimWorld-PortugueseBrazilian`**
    60  
    61  With this path in hand, running `xml-comp -translation your/path/to/translation` will let you know in every file of your project what is missing by adding lines to it with what is needed to translate! That simple!
    62  
    63  #### [RIMWORLD not installed in standard path]
    64  If by any reason you did not install the game on Steam's standard path or want to use a different one, It's possible to use the `original` flag that exposes your customized path to the game as shows: 
    65  
    66  - **`"original"`**: Full path directory of your RimWorld English folder (optional).
    67  My "original" path (optional): **`/Users/arthur/Library/Application Support/Steam/steamapps/common/RimWorld/RimWorldMac.app/Mods/Core/Languages/English`**
    68  
    69  In order to use this flag you'll need to parse it with the `translation` flag as in: `xml-comp -original path/... -translation path/...`
    70  
    71  #### Comparing any kind of document
    72  To compare any kind of files, all you need is to use the flag `-doc <type name>`, eg `-doc html`. This will use the paths that you gave only to compare the specified type of document. Another example:
    73  
    74  ```shell
    75  $ XML-Comp -doc html -original path/to/It -translation path/to/It
    76  ```
    77  
    78  OBS: This is not required, by default It's comparing all `.xml` files that are encountered.
    79  
    80  #### [Contributing](https://github.com/XML-Comp/XML-Comp/blob/master/Contributing.md)
    81  
    82  #### [Join our Gitter](https://gitter.im/XML-Comparer/Lobby)
    83  #### To Do - Check our [Issues](https://github.com/XML-Comp/XML-Comp/issues) & [Milestones](https://github.com/XML-Comp/XML-Comp/milestones)
    84  
    85  ## Using only the comparer package
    86  ```go
    87  // Import the package
    88  import "github.com/XML-Comp/XML-Comp/comparer"
    89  // Set document type variable to the desired document
    90  // without the "." | eg: "xml" or "html"
    91  comparer.DocType = "html"
    92  // Start the main function with the full paths to compare
    93  // the firstPath is always what will be used as model
    94  func main() {
    95      err := comparer.Compare(firstPath, comparingPath)
    96      if err != nil {
    97          log.Fatal(err)
    98      }
    99  }
   100  ```