diff --git a/.commitlog.release b/.commitlog.release deleted file mode 100755 index 1c5ae58..0000000 --- a/.commitlog.release +++ /dev/null @@ -1 +0,0 @@ -v3.0.0 \ No newline at end of file diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml deleted file mode 100644 index dd081a4..0000000 --- a/.github/workflows/changelog.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Changelogs - -on: - push: - tags: "*" - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: Generate Change Log - id: generate_log - run: | - curl -sSL https://goblin.run/github.com/barelyhuman/commitlog/v3@v3 | sh - commitlog g > CHANGELOG.md - - uses: ncipollo/release-action@v1 - with: - bodyFile: "CHANGELOG.md" - token: ${{ secrets.GH_TOKEN }} diff --git a/.github/workflows/create-binaries.yml b/.github/workflows/create-binaries.yml deleted file mode 100644 index 5b9495d..0000000 --- a/.github/workflows/create-binaries.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Binary Builds - -on: - release: - types: - - created - -jobs: - releases-matrix: - name: Release Go Binary - runs-on: ubuntu-latest - strategy: - matrix: - goos: [linux, windows, darwin] - goarch: ["386", amd64, arm64] - exclude: - - goarch: "386" - goos: darwin - - goarch: arm64 - goos: windows - steps: - - uses: actions/checkout@v3 - - uses: wangyoucao577/go-release-action@v1 - with: - github_token: ${{ secrets.GH_TOKEN }} - goos: ${{ matrix.goos }} - goarch: ${{ matrix.goarch }} - ldflags: "-w -s" diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index 2f5e324..0000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Docs -on: [push] -jobs: - build-docs: - concurrency: ci-${{ github.ref }} - runs-on: ubuntu-latest - steps: - - name: Checkout 🛎️ - uses: actions/checkout@v3 - - - name: Install and Build - run: ./scripts/generate-docs.sh - - - name: Deploy 🚀 - uses: JamesIves/github-pages-deploy-action@v4.3.3 - with: - token: ${{ secrets.GH_TOKEN }} - branch: gh-pages - folder: dist diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 93d4b6c..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Test - -on: - - push - - pull_request - -jobs: - build_and_test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: 1.16 - - - name: Build - run: go build -v ./... - - - name: Test - run: go test -v ./... diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 2cb6b8d..0000000 --- a/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -CHANGELOG.md -./commitlog -.DS_Store -dist -commitlog -lab -api_urls.json -/bin \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md deleted file mode 100644 index e9c60d8..0000000 --- a/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,128 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -We as members, contributors, and leaders pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, body -size, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socio-economic status, -nationality, personal appearance, race, religion, or sexual identity -and orientation. - -We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. - -## Our Standards - -Examples of behavior that contributes to a positive environment for our -community include: - -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -* Focusing on what is best not just for us as individuals, but for the - overall community - -Examples of unacceptable behavior include: - -* The use of sexualized language or imagery, and sexual attention or - advances of any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email - address, without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Enforcement Responsibilities - -Community leaders are responsible for clarifying and enforcing our standards of -acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, -or harmful. - -Community leaders have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, and will communicate reasons for moderation -decisions when appropriate. - -## Scope - -This Code of Conduct applies within all community spaces, and also applies when -an individual is officially representing the community in public spaces. -Examples of representing our community include using an official e-mail address, -posting via an official social media account, or acting as an appointed -representative at an online or offline event. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement at -ahoy@barelyhuman.dev. -All complaints will be reviewed and investigated promptly and fairly. - -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. - -## Enforcement Guidelines - -Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: - -### 1. Correction - -**Community Impact**: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. - -**Consequence**: A private, written warning from community leaders, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. - -### 2. Warning - -**Community Impact**: A violation through a single incident or series -of actions. - -**Consequence**: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or -permanent ban. - -### 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including -sustained inappropriate behavior. - -**Consequence**: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. - -### 4. Permanent Ban - -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within -the community. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 2.0, available at -https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. - -Community Impact Guidelines were inspired by [Mozilla's code of conduct -enforcement ladder](https://github.com/mozilla/diversity). - -[homepage]: https://www.contributor-covenant.org - -For answers to common questions about this code of conduct, see the FAQ at -https://www.contributor-covenant.org/faq. Translations are available at -https://www.contributor-covenant.org/translations. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index c05e689..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,18 +0,0 @@ -You are free to raise PR's for any kind of improvements and or feature additions, they'll be added to the repository accordingly, you can also fork up your own version as the repo will remain MIT licensed - -## Dev Guidelines -- Fork the Repo -- Make your changes (use `git pull --rebase` when working with others to avoid creating un-needed merge commits ) -- Raise a PR -- Your changes will then be reviewed and merged into a test pr-#id-rebase branch for testing -and then merged into `main` if everything goes through - -## Pull Request and Commit Guidelines -- Commitlog is based off of commit standards where the commit message specifies what -kind of commit it is, make sure your commits follow the same. -- The PR doesn't need to have detailed explanation but a small pointer of what each commit does should be fine, -on the other hand you could use commitlog to generate the hash and changes for your PR - ---- -Finally, -**Maintain a healthy and friendly environment in all the threads (discussions, issue thread, PR Threads)** diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 3b6b066..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 Reaper - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/README.md b/README.md deleted file mode 100644 index 80b44e0..0000000 --- a/README.md +++ /dev/null @@ -1,43 +0,0 @@ -

- -

commits to changelogs

- -[![Go Report Card](https://goreportcard.com/badge/github.com/barelyhuman/commitlog)](https://goreportcard.com/report/github.com/barelyhuman/commitlog) - -## Philosophy - -- Work on all major operating systems -- Not platform dependent, not tied to Github, Gitlab, or anything. It's just markdown. -- Ability to generate change logs between version tags -- Handle release versioning of the project -- Stay small - -## Installation - - -### Using [goblin.run](https://goblin.run) -```sh -; curl -sfL https://goblin.run/github.com/barelyhuman/commitlog/v3 | sh -``` - -### go -If you have go installed, you can use the below command - -```sh -go install github.com/barelyhuman/commitlog/v3@latest -``` - -## Why - -Every language has it's own isolated version of a tool like this, for someone who works with multiple languages, it's easier to -have the same tool working everywhere, without having to setup something get it working. There's an even tighter scoped version of this, [nimclog](https://github.com/barelyhuman/nimclog). - -The point of the tool is not to create super descriptive changelogs for you but to help your changelogs have enough information for you as a developer to be able to write proper changelogs while having references to the changes in one place. - -## Documentation - -The documentation can be read from the `docs` folder of the repository, or on the [website](https://barelyhuman.github.io/commitlog) - -## License - -[MIT](/LICENSE) diff --git a/api.html b/api.html new file mode 100644 index 0000000..9f341f8 --- /dev/null +++ b/api.html @@ -0,0 +1,64 @@ +
+Codestin Search App + + +

commitlog

+

Home Manual Download API

+

API

+

General Guide

+

commitlog also comes as a pkg that you could reuse to modify the behaviour of +the commands and this is very limited at the moment since I'm still working on +the best way to get plugins to work with the original CLI instead of having to +write your own version of commitlog.

+

The pkg contains the 2 base command's creators and behaviour modifiers, or more +commonly known as the golang options pattern.

+

Briefly put, You have one function that takes in unlimited amount of functions +as parameter with each of these parameter functions being able to modify the +behaviour of the returned instance.

+

Easy way to explain this is with an example of the releaser API

+
package main
+
+import (
+    "log"
+
+    "github.com/barelyhuman/commitlog/v3/pkg"
+)
+
+func main() {
+    versionString := "v0.0.1"
+    releaser, _ := pkg.CreateNewReleaser(
+        versionString,
+        pkg.WithMajorIncrement(),
+    )
+
+    log.Println(releaser.String())
+
+}
+
+

here the pkg.CreateNewReleaser takes in one mandatory value which is the +versionString and the 2nd parameter is optional here.

+

Though, since we wish for the releaser to have a custom behaviour everytime the +flags change, instead of writing entire functionalities inside various releaser +functions, which would look like so

+
releaser.IncrementMajor()
+releaser.IncrementMinor()
+
+

I'd be unable to expose the builders / option functions out to the public for +them to write custom behaviours that work directly with the struct being used +by commitlog itself and instead you'd be writing wrappers around existing +functions. Thus, adding another layer of abstraction which isn't needed for +something that wants to be extended.

+

This approach gives me the ability to expose a selected few properties for you +to modify while writing your own builder/option function.

+

The only pointer functions that releaser has is the one's that'll help with +printing or identifying the final version's state.

+

Since, you now know how the API is written, the go doc for this module should be +able to help you with the remaining.

+

godoc↗

+
+

Note: if the go doc still hasn't been generated for v2.0.0, please go +through the source code to help you with the implementation details

+
+
\ No newline at end of file diff --git a/assets/commitlog.png b/assets/commitlog.png deleted file mode 100644 index 30112e7..0000000 Binary files a/assets/commitlog.png and /dev/null differ diff --git a/commands/commitlog.go b/commands/commitlog.go deleted file mode 100644 index 1ade19d..0000000 --- a/commands/commitlog.go +++ /dev/null @@ -1,70 +0,0 @@ -package commands - -import ( - "github.com/barelyhuman/commitlog/v3/pkg" - "github.com/urfave/cli/v2" -) - -func Commitlog(c *cli.Context) (err error) { - path := c.String("path") - addPromo := c.Bool("promo") - out := c.String("out") - stdio := c.Bool("stdio") - startRef := c.String("start") - endRef := c.String("end") - categories := c.String("categories") - - gOptions := []pkg.GeneratorConfigMod{} - - if addPromo { - gOptions = append(gOptions, - pkg.WithPromo(), - ) - } - - // either write to a file or to the stdio with true by default - if len(out) > 0 { - gOptions = append(gOptions, - pkg.WithOutputToFile(out), - ) - } else if stdio { - gOptions = append(gOptions, - pkg.WithOutputToStdio(), - ) - } - - if len(startRef) > 0 { - gOptions = append(gOptions, - pkg.WithStartReference(startRef), - ) - } - - if len(endRef) > 0 { - gOptions = append(gOptions, - pkg.WithEndReference(endRef), - ) - } - - if len(categories) > 0 { - gOptions = append(gOptions, - pkg.WithCategories(categories), - ) - } - - generator := pkg.CreateGenerator(path, - gOptions...) - - err = generator.ReadCommmits() - - if err != nil { - return err - } - - err = generator.Classify() - - if err != nil { - return err - } - - return generator.Generate() -} diff --git a/commands/release.go b/commands/release.go deleted file mode 100644 index 99ce039..0000000 --- a/commands/release.go +++ /dev/null @@ -1,145 +0,0 @@ -package commands - -import ( - "fmt" - "os" - "os/exec" - "path" - - "github.com/barelyhuman/commitlog/v3/lib" - "github.com/barelyhuman/commitlog/v3/pkg" - "github.com/go-git/go-git/v5" - "github.com/go-git/go-git/v5/plumbing" - "github.com/urfave/cli/v2" -) - -func Release(c *cli.Context) (err error) { - - fileDir := c.String("path") - filePath := path.Join(fileDir, ".commitlog.release") - - if !(c.Bool("init") || c.Bool("major") || c.Bool("minor") || c.Bool("patch") || c.Bool("pre")) { - err = fmt.Errorf("[commitlog] need at least one increment flag to move ahead") - return - } - - if c.Bool("init") { - _, err = os.Stat(filePath) - if os.IsNotExist(err) { - err = nil - os.WriteFile(filePath, []byte("v0.0.0"), os.ModePerm) - fmt.Println("[commitlog] Initialized commitlog release") - } else { - err = fmt.Errorf(".commitlog.release already exists, cannot override") - } - return - } - - _, err = os.Stat(filePath) - - if os.IsNotExist(err) { - err = fmt.Errorf("couldn't find the release file, please run the `--init` flag first") - return - } - - fileData, err := os.ReadFile(filePath) - - if err != nil { - err = fmt.Errorf("error reading the version file: %v", err) - return err - } - - versionString := string(fileData) - - releaserOpts := []pkg.ReleaserMod{ - // add in the pre-tag, - // will be used only if the pre flag - // is true - pkg.WithPreTag(c.String("pre-tag")), - } - - if c.Bool("major") { - releaserOpts = append(releaserOpts, pkg.WithClearPrerelease(), pkg.WithMajorIncrement(), pkg.WithMinorReset(), pkg.WithPatchReset()) - } - - if c.Bool("minor") { - releaserOpts = append(releaserOpts, pkg.WithClearPrerelease(), pkg.WithMinorIncrement(), pkg.WithPatchReset()) - } - - if c.Bool("patch") { - releaserOpts = append(releaserOpts, pkg.WithClearPrerelease(), pkg.WithPatchIncrement()) - } - - if c.Bool("pre") { - releaserOpts = append(releaserOpts, pkg.WithPrereleaseIncrement()) - } - - releaser, err := pkg.CreateNewReleaser(versionString, releaserOpts...) - - if err != nil { - return err - } - - err = os.WriteFile(filePath, []byte(releaser.String()), os.ModePerm) - if err != nil { - return - } - - var gitRepo *git.Repository - var toTagHash plumbing.Hash - var repoWt *git.Worktree - - if c.Bool("commit") || c.Bool("push") { - gitRepo, err = git.PlainOpen(c.String("path")) - if err != nil { - return err - } - - repoWt, err = gitRepo.Worktree() - - if err != nil { - return err - } - } - - if c.Bool("commit") { - msg := "chore: " + releaser.String() - repoWt.Add(filePath) - toTagHash, err = repoWt.Commit(msg, &git.CommitOptions{}) - if err != nil { - return err - } - - _, err = gitRepo.CreateTag(releaser.String(), toTagHash, &git.CreateTagOptions{ - Message: msg, - }) - if err != nil { - err = fmt.Errorf("looks like there was error while creating a tag for the version commit, please try again or create a tag manually: %v", err) - return err - } - } - - if c.Bool("push") { - _, err = repoWt.Status() - if err != nil { - return err - } - - cmd := exec.Command("git", "push") - cmd.Dir = fileDir - err = lib.Command(cmd) - - if err != nil { - return err - } - - cmd = exec.Command("git", "push", "--tags") - cmd.Dir = fileDir - - if err = lib.Command(cmd); err != nil { - return err - } - } - - return err -} diff --git a/docs/api.md b/docs/api.md deleted file mode 100644 index 3f66656..0000000 --- a/docs/api.md +++ /dev/null @@ -1,81 +0,0 @@ - -Codestin Search App - - - -### [commitlog](/) - -[Home](/) [Manual](/manual) [Download](/download) [API](/api) - -# API - -### General Guide - -commitlog also comes as a pkg that you could reuse to modify the behaviour of -the commands and this is very limited at the moment since I'm still working on -the best way to get plugins to work with the original CLI instead of having to -write your own version of commitlog. - -The pkg contains the 2 base command's creators and behaviour modifiers, or more -commonly known as the golang options pattern. - -Briefly put, You have one function that takes in unlimited amount of functions -as parameter with each of these parameter functions being able to modify the -behaviour of the returned instance. - -Easy way to explain this is with an example of the `releaser` API - -```go -package main - -import ( - "log" - - "github.com/barelyhuman/commitlog/v3/pkg" -) - -func main() { - versionString := "v0.0.1" - releaser, _ := pkg.CreateNewReleaser( - versionString, - pkg.WithMajorIncrement(), - ) - - log.Println(releaser.String()) - -} -``` - -here the `pkg.CreateNewReleaser` takes in one mandatory value which is the -`versionString` and the 2nd parameter is optional here. - -Though, since we wish for the releaser to have a custom behaviour everytime the -flags change, instead of writing entire functionalities inside various releaser -functions, which would look like so - -```go -releaser.IncrementMajor() -releaser.IncrementMinor() -``` - -I'd be unable to expose the builders / option functions out to the public for -them to write custom behaviours that work directly with the `struct` being used -by commitlog itself and instead you'd be writing wrappers around existing -functions. Thus, adding another layer of abstraction which isn't needed for -something that wants to be extended. - -This approach gives me the ability to expose a selected few properties for you -to modify while writing your own builder/option function. - -The only pointer functions that releaser has is the one's that'll help with -printing or identifying the final version's state. - -Since, you now know how the API is written, the go doc for this module should be -able to help you with the remaining. - -[godoc↗](https://pkg.go.dev/github.com/barelyhuman/commitlog) - -> **Note**: if the go doc still hasn't been generated for v2.0.0, please go -> through the source code to help you with the implementation details diff --git a/docs/download.md b/docs/download.md deleted file mode 100644 index 989b599..0000000 --- a/docs/download.md +++ /dev/null @@ -1,27 +0,0 @@ - -Codestin Search App - - - -### [commitlog](/) - -[Home](/) [Manual](/manual) [Download](/download) [API](/api) - -#### Downloads - -[commitlog-v3.0.0-darwin-amd64.tar.gz](https://github.com/barelyhuman/commitlog/releases/download/v3.0.0/commitlog-v3.0.0-darwin-amd64.tar.gz) -[commitlog-v3.0.0-darwin-amd64.tar.gz.md5](https://github.com/barelyhuman/commitlog/releases/download/v3.0.0/commitlog-v3.0.0-darwin-amd64.tar.gz.md5) -[commitlog-v3.0.0-darwin-arm64.tar.gz](https://github.com/barelyhuman/commitlog/releases/download/v3.0.0/commitlog-v3.0.0-darwin-arm64.tar.gz) -[commitlog-v3.0.0-darwin-arm64.tar.gz.md5](https://github.com/barelyhuman/commitlog/releases/download/v3.0.0/commitlog-v3.0.0-darwin-arm64.tar.gz.md5) -[commitlog-v3.0.0-linux-386.tar.gz](https://github.com/barelyhuman/commitlog/releases/download/v3.0.0/commitlog-v3.0.0-linux-386.tar.gz) -[commitlog-v3.0.0-linux-386.tar.gz.md5](https://github.com/barelyhuman/commitlog/releases/download/v3.0.0/commitlog-v3.0.0-linux-386.tar.gz.md5) -[commitlog-v3.0.0-linux-amd64.tar.gz](https://github.com/barelyhuman/commitlog/releases/download/v3.0.0/commitlog-v3.0.0-linux-amd64.tar.gz) -[commitlog-v3.0.0-linux-amd64.tar.gz.md5](https://github.com/barelyhuman/commitlog/releases/download/v3.0.0/commitlog-v3.0.0-linux-amd64.tar.gz.md5) -[commitlog-v3.0.0-linux-arm64.tar.gz](https://github.com/barelyhuman/commitlog/releases/download/v3.0.0/commitlog-v3.0.0-linux-arm64.tar.gz) -[commitlog-v3.0.0-linux-arm64.tar.gz.md5](https://github.com/barelyhuman/commitlog/releases/download/v3.0.0/commitlog-v3.0.0-linux-arm64.tar.gz.md5) -[commitlog-v3.0.0-windows-386.zip](https://github.com/barelyhuman/commitlog/releases/download/v3.0.0/commitlog-v3.0.0-windows-386.zip) -[commitlog-v3.0.0-windows-386.zip.md5](https://github.com/barelyhuman/commitlog/releases/download/v3.0.0/commitlog-v3.0.0-windows-386.zip.md5) -[commitlog-v3.0.0-windows-amd64.zip](https://github.com/barelyhuman/commitlog/releases/download/v3.0.0/commitlog-v3.0.0-windows-amd64.zip) -[commitlog-v3.0.0-windows-amd64.zip.md5](https://github.com/barelyhuman/commitlog/releases/download/v3.0.0/commitlog-v3.0.0-windows-amd64.zip.md5) diff --git a/docs/index.md b/docs/index.md deleted file mode 100644 index faf4305..0000000 --- a/docs/index.md +++ /dev/null @@ -1,128 +0,0 @@ - -Codestin Search App - - - -### [commitlog](/) - -[Home](/) [Manual](/manual) [Download](/download) [API](/api) - -#### Index - -- [Source](https://github.com/barelyhuman/commitlog) -- [Quick Start](#quick-start) -- [About](#about) - - [Philosophy](#philosophy) - - [Installation](#installation) -- [Manual](/manual) -- [License](#license) - -

Quick Start

- -For the one's who already know the tool and wanna get started quickly. - -You can get the CLI in the following ways - -1. You can get the binaries from the [download section](/download) - -2. Using `go` - -```sh -go get -u github.com/barelyhuman/commitlog/v3 -# or -go install github.com/barelyhuman/commitlog/v3@latest -``` - -3. Using goblin - -```sh -curl -sf https://goblin.run/github.com/barelyhuman/commitlog/v3 | OUT=commitlog sh -``` - -Once installed you can just run `commitlog generate` or the shorter version -`commitlog g` to get all the changes between the recent tags. - -

About

- -
Philosophy
- -**_commitlog_** simply exists because I wasn't able to find a decent enough tool -to do this without being bound to a specific programming language and it's -toolset. The closes one to this is the `git`'s own `shortlog` and `log` commands - -- **Language Agnostic** - No one needs the entire programming toolset or the - language to be setup on the system to be able to just generate logs - -- **Decently Sized** - Not everyone has a powerful system and CI systems are - still very limited in terms of resources since they give you shared spaces and - automating generating this is a common practice so it doesn't make sense for - it to install a runtime worth 100MB to run it. - - The binary itself is around 10-13MB which is fairly big for a tool like this - but this is due to go's nature of embedding the platform runtime with the - binary and this might not be ideal for some and so there's another similar - smaller scoped version [nimclog](https://github.com/barelyhuman/nimclog) which - is in KB's - -- **Flexible** - There are no set standards for how you write commit messages. - Commitlint is a good standard and pretty widely used and also what commitlog - v1 used as the base for categorizing. - - V2 however, doesn't have a set commit category standard, it accepts regex's - that you will categorize your commits for you. - - This is more for experienced developers who have a their own pattern of - writing commits and would like a tool that'd work with their pattern instead - of creating friction - -- **Extensible** - The entire thing is open source and MIT licenses, - specifically for you to be able to fix and add things as needed. Each command - has been kept away from the domain logic to be able to use `commitlog` even as - a library and build your own tool if you wish to, though if there's something - you wish the CLI supported, you are free to open issues and I really like - people helping with the development since that helps keeping the tool alive - longer. - -
Installation
- -The installation is pretty straightforwad. You [download](/download) the binary -from the download section of this website or use something like -[goblin](https://goblin.run) to build the binary for your specific -system (rarely needed) since the releases actually accommodate the most used -operating systems and architectures already. - -**Linux/Mac (Unix Systems)** - -Once downloaded, you can use the `install` command on \*nix systems to link the -binary to a location that's already in your PATH variable. - -eg: - -```bash -# install commitlog from current directory to the /usr/local/bin directory -install $(pwd)/commitlog /usr/local/bin -``` - -This should give you the ability to use the `commitlog` command anywhere in your -system - -**Windows** - -Similar to the linux setup, you can download the `.exe` file and add it to a -location that your environment path already has. An easier thing to do is to -store the entire thing in your secondary partition and add that location to your -PATH. You can use this resource from Java docs to help you with modifying the -PATH variables - -- [Modifying PATH in Windows](https://www.java.com/en/download/help/path.html) - -

Manual

- -[Read Manual →](/manual) - -

License

- -commitlog is MIT Licensed and you can read the entire license in the -[source code](https://github.com/barelyhuman/commitlog) diff --git a/docs/manual.md b/docs/manual.md deleted file mode 100644 index e3c79c8..0000000 --- a/docs/manual.md +++ /dev/null @@ -1,320 +0,0 @@ - -Codestin Search App - - - -### [commitlog](/) - -[Home](/) [Manual](/manual) [Download](/download) [API](/api) - -# Manual - -- [Basics](#basics) - - [generate](#generate) - - [release](#release) -- [Advanced](#advanced) - - [Selective Log Ranges](#selective-log-ranges) - - [From a different repo](#from-a-different-repo) - - [Categorize](#categorize) -- [CLI](#cli) -- [API](/api) - -

Basics

- -**_`commitlog`_** come with 2 basic functionalities - -- Generating commits as changelogs in markdown -- Managing your version and tags - -Both the above are available as sub commands and we'll go through each one by -one. - -Just running `commitlog` no longer works as it did in v1, you'll need to specify -a sub command to get it working. - -This has been done to keep it simpler to keep arbitrary behaviour to a minimum - -

generate

- -The first one is `generate` and in most cases you'll just be using this to -handle generation of commits as a list of markdown notes - -Here's an example of what it'll look like to run the `generate` sub-command - -```sh -$ commitlog generate -# or -$ commitlog g -``` - -**Output**: - -```md -## All Changes -87ce3fc76b252908cdd81f9537713f8d67813652 chore: v2.0.0-beta.0 - -09fc85c0d1d52d770bbbf39ac45907103a53d354 refactor: swap go-git for push with exec - -5bafe9d105298001707c7c816e60d3ef0257a816 fix: tag creation - -909fd032facdeb4fb7633a4fad82dced28e8de83 chore: swap debugging logger with stderr printer - -``` - -The behaviour of the `generate` command is like so - -- go through all commits from the current `HEAD` (commit with the `HEAD` - reference) till the last commit or the most recent tagged commit. -- the other case is where if the latest commit is also a tagged commit, it'll - still go till the most recent tagged commit. - - eg: v0.0.2 -> HEAD, v0.0.1 -> SOMEHASH, would give you the commits between - both the tags. - -The default behaviour of **_commitlog_** is to print to the stdout of your -terminal which might not be what you wish to do. - -So, if you wish to ever write to a file , you can use the `--out FILE` flag to -write the output to a file instead. - -```sh -$ commitlog g -o ./CHANGELOG.md -``` - -> **Note**: commitlog will overwrite the file with the new output, make sure you -> create a backup of the file when working with this. - -> **Note**: In coming versions an append mode will be added to the CLI to avoid -> having to deal with this manually - -

release

- -The `release` sub-command is a complimentary sub-command added to commitlog to -help you with managing release versions. I understand that most languages have -their own package version management and you might want to work with them but -that's also why the `release` sub-command isn't something you need, it's there -for cases where you might wanna use it. - -My primary usecase is when working with repositories that work with multiple -languages and I'd prefer a unified version. - -The `release` command doesn't modify your source code files but instead handles -the version with it's own file named `.commitlog.release`, which just holds the -**version** number right now and while this does have the X.X.X format (semantic -versioning format) the increments or how you handle them doesn't have to be. - -The command is flexible enough for you to combine and create your own way of -versioning. - -##### Initialize - -```sh -$ commitlog release --init -# or -$ commitlog r --init -``` - -Once initialized, you'll see a `.commitlog.release` file in your repo with the -version `v0.0.0` to start with. - -##### Increments - -Post that you can use the remaining flags to help you incrementing the version -as needed. - -```sh -$ commitlog r --major # change to v1.0.0 -$ commitlog r --minor # change to v0.1.0 -$ commitlog r --patch # change to v0.0.1 -$ commitlog r --pre # change to v0.0.0-beta.0 -$ commitlog r --pre --pre-tag="dev" # change to v0.0.0-dev.0 - -# or go bonkers -$ commitlog r --patch --pre --pre-tag="dev" # change to v0.0.1-dev.0 -$ commitlog r --major --patch --pre --pre-tag="dev" # change to v1.0.1-dev.0 -``` - -#### Git actions - -Most times you'd also want a tool like this to create commits and tags for you -which is fair, so `release` does come with a few git actions. - -- `--commit` (will create a commit and tag it for you) -- `--push` (will push the commits and tags for you) - -The whole command would look a little something like this - -```sh -$ commitlog r --patch --commit --push -``` - -

Advanced

- -These are not really hard to guess or achieve but are in the advanced section as -this isn't something a beginner user might need to mess with. If you have other -use cases that you feel like should be added here, raise a issue. - -

Selective Log Ranges

-There's enough cases where the entire history between the tags makes no sense. You might just want a specific set of commits and this is very easy to do with commitlog - -```sh -$ commitlog g --start HEAD --end HEAD~3 -# would return the last 3 commits -``` - -And as you might have understood, commitlog does work with git's revision system -so you can reuse git's own revision pointers as needed. Though it's mostly -easier to just use the HASH since, finding the hashes in `git log` is easier -than finding the number you have to type after the `HEAD~` - -

From a different repo

-A lot more often you might need to generate logs for a sub-repo when working with a huge multirepo folder which a lot of sub-modules and switching worktree for the changelog might not be something you wish to do. - -In cases like these the `-p` or `--path` flag can be used with the `generate` -flag - -```sh -$ commitlog g -p ./sub/module -s HEAD~3 -# would return the commits from HEAD~3 to the next tag or end of all commits. -``` - -

Categorize

-You wouldn't be using commitlog otherwise so this obviously has to exist. - -As for why is this turned off by default? I just don't use commit standards and -mostly just need the commits between tags and very rarely need the categories to -help me but doesn't change the fact that someone else might need it. - -So, how does commitlog categorize? using regex's , or more like comma seperated -regex's. - -The implementation approach might bring some issue but I'm going to wait for -them instead of over fixing something that might never really happen. - -Anyway, a simple example for a non-scoped commitlint styled categorization would -look something like this . - -```sh -$ commitlog g --categories="feat:,fix:" -``` - -**Output:** - -```md -## feat: -110c9b260e6de1e2be9af28b3592c373ab6fc501 feat: handling for pre increment - -9080580575d3579b3d11dd114830eb128f0c8130 feat: releaser base maj,min,patch setup - -b513e53cbbc30e5b667fbba373b9589911a47ac0 feat: generator subcommand implementation - -## fix: -5bafe9d105298001707c7c816e60d3ef0257a816 fix: tag creation -``` - -This could be made a little more neater using a better regex like so - -```sh -$ commitlog g --categories="^feat,^fix" -``` - -**Output**: - -```md -## ^feat -e0ce9c693c554158b7b4841b799524164d9c3e83 feat(releaser): add init and pre-tag handlers - -110c9b260e6de1e2be9af28b3592c373ab6fc501 feat: handling for pre increment - -9080580575d3579b3d11dd114830eb128f0c8130 feat: releaser base maj,min,patch setup - -b513e53cbbc30e5b667fbba373b9589911a47ac0 feat: generator subcommand implementation - -## ^fix -5bafe9d105298001707c7c816e60d3ef0257a816 fix: tag creation - -540bb3d7419aab314fdb999dd57eeac3c53f5fad fix doc generation - -87d40ddbd463ad71b3af8b7edb8ac8176ecbf2f5 fix tests for new param -``` - -As visible, you find more commits in the 2nd one since the regex matches more -cases and gives you more information. You are free to modify these to make them -work with other patterns that you might follow. - -Also the titles are going to be the regex's you pass. A future version will add -a way for you to add label's to the regex though that's a little harder to -achieve without making the flags very verbose so I've avoided it for now. - -> **Note**: This is the initial implementation of this and might change in a -> future major version since this flag feels a little more frictional than the -> other approaches I have in mind. Feel free to recommend other ways to do this. - -

CLI

- -This is the entire CLI reference, which you can also access by using the `-h` -flag on the downloaded binary. - -**`commitlog -h`** - -``` -NAME: - commitlog - commits to changelogs - -USAGE: - commitlog [global options] command [command options] [arguments...] - -COMMANDS: - generate, g commits to changelogs - release, r manage .commitlog.release version - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --help, -h show help (default: false) -``` - ---- - -**`commitlog g -h`** - -``` -NAME: - commitlog generate - commits to changelogs - -USAGE: - commitlog generate [command options] [arguments...] - -OPTIONS: - --categories value categories to use, includes all commits by default. any text you add here will be used to create categories out of the commits - --end END, -e END END reference for the commit to stop including commits at.This is exclusive of the given commit reference - --out FILE, -o FILE path to the output FILE - --path PATH, -p PATH root with the '.git' folder PATH (default: ".") - --promo add promo text to the end of output (default: false) - --start START, -s START START reference for the commit to include commits from,This is inclusive of the given commit reference - --stdio print to the stdout (default: true) -``` - ---- - -**`commitlog r -h`** - -``` -NAME: - commitlog release - manage .commitlog.release version - -USAGE: - commitlog release [command options] [arguments...] - -OPTIONS: - --commit if true will create a commit and tag, of the changed version (default: false) - --init initialise commitlog release (default: false) - --major create a major version (default: false) - --minor create a minor version (default: false) - --patch create a patch version (default: false) - --path PATH, -p PATH PATH to a folder where .commitlog.release exists or is to be created.(note: do not use `--commit` or `--push` if the file isn't in the root) (default: ".") - --pre create a pre-release version. will default to patch increment unlessspecified and not already a pre-release (default: false) - --pre-tag value create a pre-release version (default: "beta") - --push if true will create push the created release commit + tag on origin (default: false) -``` diff --git a/download.html b/download.html new file mode 100644 index 0000000..43b98d5 --- /dev/null +++ b/download.html @@ -0,0 +1,24 @@ +
+Codestin Search App + + +

commitlog

+

Home Manual Download API

+

Downloads

+

commitlog-v3.0.0-darwin-amd64.tar.gz
+commitlog-v3.0.0-darwin-amd64.tar.gz.md5
+commitlog-v3.0.0-darwin-arm64.tar.gz
+commitlog-v3.0.0-darwin-arm64.tar.gz.md5
+commitlog-v3.0.0-linux-386.tar.gz
+commitlog-v3.0.0-linux-386.tar.gz.md5
+commitlog-v3.0.0-linux-amd64.tar.gz
+commitlog-v3.0.0-linux-amd64.tar.gz.md5
+commitlog-v3.0.0-linux-arm64.tar.gz
+commitlog-v3.0.0-linux-arm64.tar.gz.md5
+commitlog-v3.0.0-windows-386.zip
+commitlog-v3.0.0-windows-386.zip.md5
+commitlog-v3.0.0-windows-amd64.zip
+commitlog-v3.0.0-windows-amd64.zip.md5

+
\ No newline at end of file diff --git a/go.mod b/go.mod deleted file mode 100644 index a27a5ce..0000000 --- a/go.mod +++ /dev/null @@ -1,9 +0,0 @@ -module github.com/barelyhuman/commitlog/v3 - -go 1.16 - -require ( - github.com/go-git/go-git/v5 v5.8.1 - github.com/urfave/cli/v2 v2.25.7 - golang.org/x/mod v0.12.0 -) diff --git a/go.sum b/go.sum deleted file mode 100644 index 45ab591..0000000 --- a/go.sum +++ /dev/null @@ -1,186 +0,0 @@ -dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= -dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= -github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= -github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= -github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= -github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= -github.com/ProtonMail/go-crypto v0.0.0-20230717121422-5aa5874ade95 h1:KLq8BE0KwCL+mmXnjLWEAOYO+2l2AE4YMmqG1ZpZHBs= -github.com/ProtonMail/go-crypto v0.0.0-20230717121422-5aa5874ade95/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= -github.com/acomagu/bufpipe v1.0.4 h1:e3H4WUzM3npvo5uv95QuJM3cQspFNtFBzvJ2oNjKIDQ= -github.com/acomagu/bufpipe v1.0.4/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= -github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8= -github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4= -github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= -github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= -github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= -github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/elazarl/goproxy v0.0.0-20221015165544-a0805db90819 h1:RIB4cRk+lBqKK3Oy0r2gRX4ui7tuhiZq2SuTtTCi0/0= -github.com/elazarl/goproxy v0.0.0-20221015165544-a0805db90819/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM= -github.com/elazarl/goproxy/ext v0.0.0-20190711103511-473e67f1d7d2/go.mod h1:gNh8nYJoAm43RfaxurUnxr+N1PwuFV3ZMl/efxlIlY8= -github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= -github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= -github.com/gliderlabs/ssh v0.3.5 h1:OcaySEmAQJgyYcArR+gGGTHCyE7nvhEMTlYY+Dp8CpY= -github.com/gliderlabs/ssh v0.3.5/go.mod h1:8XB4KraRrX39qHhT6yxPsHedjA08I/uBVwj4xC+/+z4= -github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= -github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= -github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= -github.com/go-git/go-billy/v5 v5.4.1 h1:Uwp5tDRkPr+l/TnbHOQzp+tmJfLceOlbVucgpTz8ix4= -github.com/go-git/go-billy/v5 v5.4.1/go.mod h1:vjbugF6Fz7JIflbVpl1hJsGjSHNltrSw45YK/ukIvQg= -github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20230305113008-0c11038e723f h1:Pz0DHeFij3XFhoBRGUDPzSJ+w2UcK5/0JvF8DRI58r8= -github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20230305113008-0c11038e723f/go.mod h1:8LHG1a3SRW71ettAD/jW13h8c6AqjVSeL11RAdgaqpo= -github.com/go-git/go-git/v5 v5.8.1 h1:Zo79E4p7TRk0xoRgMq0RShiTHGKcKI4+DI6BfJc/Q+A= -github.com/go-git/go-git/v5 v5.8.1/go.mod h1:FHFuoD6yGz5OSKEBK+aWN9Oah0q54Jxl0abmj6GnqAo= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= -github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= -github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= -github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= -github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= -github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/matryer/is v1.2.0 h1:92UTHpy8CDwaJ08GqLDzhhuixiBUUD1p3AU6PHddz4A= -github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= -github.com/mmcloughlin/avo v0.5.0/go.mod h1:ChHFdoV7ql95Wi7vuq2YT1bwCJqiWdZrQ1im3VujLYM= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= -github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rogpeppe/go-charset v0.0.0-20180617210344-2471d30d28b4/go.mod h1:qgYeAmZ5ZIpBWTGllZSQnw97Dj+woV0toclVaRGI8pc= -github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= -github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= -github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= -github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/skeema/knownhosts v1.2.0 h1:h9r9cf0+u7wSE+M183ZtMGgOJKiL96brpaz5ekfJCpM= -github.com/skeema/knownhosts v1.2.0/go.mod h1:g4fPeYpque7P0xefxtGzV81ihjC8sX2IqpAoNkjxbMo= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/urfave/cli/v2 v2.25.7 h1:VAzn5oq403l5pHjc4OhD54+XGO9cdKVL/7lDjF+iKUs= -github.com/urfave/cli/v2 v2.25.7/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ= -github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= -github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= -github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= -github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -golang.org/x/arch v0.1.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220826181053-bd7e27e6170d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= -golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= -golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA= -golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= -golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= -golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50= -golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= -golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.0.0-20220722155259-a9ba230a4035/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= -golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.10.0 h1:3R7pNqamzBraeqj/Tj8qt1aQ2HpmlC+Cx/qL/7hn4/c= -golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= -golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= -golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= -gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= diff --git a/index.html b/index.html new file mode 100644 index 0000000..1e7c5b6 --- /dev/null +++ b/index.html @@ -0,0 +1,112 @@ +
+Codestin Search App + + +

commitlog

+

Home Manual Download API

+

Index

+ +

Quick Start

+

For the one's who already know the tool and wanna get started quickly.

+

You can get the CLI in the following ways

+
    +
  1. +

    You can get the binaries from the download section

    +
  2. +
  3. +

    Using go get

    +
  4. +
+
go get -u github.com/barelyhuman/commitlog/v3
+
+
    +
  1. Using goblin
  2. +
+
curl -sf https://goblin.run/github.com/barelyhuman/commitlog/v3@v3 | sh
+
+

Once installed you can just run commitlog generate or the shorter version +commitlog g to get all the changes between the recent tags.

+

About

+
Philosophy
+

commitlog simply exists because I wasn't able to find a decent enough tool +to do this without being bound to a specific programming language and it's +toolset. The closes one to this is the git's own shortlog and log commands

+ +
Installation
+

The installation is pretty straightforwad. You download the binary +from the download section of this website or use something like +goblin to build the binary for your specific +system (rarely needed) since the releases actually accommodate the most used +operating systems and architectures already.

+

Linux/Mac (Unix Systems)

+

Once downloaded, you can use the install command on *nix systems to link the +binary to a location that's already in your PATH variable.

+

eg:

+
# install commitlog from current directory to the /usr/local/bin directory
+install $(pwd)/commitlog /usr/local/bin
+
+

This should give you the ability to use the commitlog command anywhere in your +system

+

Windows

+

Similar to the linux setup, you can download the .exe file and add it to a +location that your environment path already has. An easier thing to do is to +store the entire thing in your secondary partition and add that location to your +PATH. You can use this resource from Java docs to help you with modifying the +PATH variables

+ +

Manual

+

Read Manual →

+

License

+

commitlog is MIT Licensed and you can read the entire license in the +source code

+
\ No newline at end of file diff --git a/lib/commands.go b/lib/commands.go deleted file mode 100644 index b8fb4b4..0000000 --- a/lib/commands.go +++ /dev/null @@ -1,18 +0,0 @@ -package lib - -import ( - "log" - "os/exec" - "strings" -) - -func Command(cmd *exec.Cmd) error { - var w strings.Builder - cmd.Stderr = &w - err := cmd.Run() - if err != nil { - log.Println(strings.TrimSpace(w.String())) - return err - } - return nil -} diff --git a/lib/commits.go b/lib/commits.go deleted file mode 100644 index b71616c..0000000 --- a/lib/commits.go +++ /dev/null @@ -1,51 +0,0 @@ -package lib - -import ( - "log" - "strings" - - "github.com/go-git/go-git/v5" - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/object" -) - -func IsHashATag(currentRepository *git.Repository, hash plumbing.Hash) bool { - isTag := false - tags, _ := currentRepository.Tags() - tags.ForEach(func(tagRef *plumbing.Reference) error { - revHash, err := currentRepository.ResolveRevision(plumbing.Revision(tagRef.Name())) - if err != nil { - return err - } - if *revHash == hash { - isTag = true - } - return nil - }) - return isTag -} - -func GetCommitFromString(repo *git.Repository, commitString string) *object.Commit { - if commitString == "" { - return nil - } - - hash, err := repo.ResolveRevision(plumbing.Revision(commitString)) - if err != nil { - log.Fatal("Unable to get Repo head:", err) - } - - commitRef, err := repo.CommitObject(*hash) - if err != nil { - log.Fatal("Unable to get resolve commit:", err) - } - return commitRef -} - -func CommitToLog(c *object.Commit) string { - var commitMsg strings.Builder - commitMsg.WriteString(c.Hash.String()) - commitMsg.WriteString(" ") - commitMsg.WriteString(strings.Split(c.Message, "\n")[0]) - return commitMsg.String() -} diff --git a/main.go b/main.go deleted file mode 100644 index 87fed6b..0000000 --- a/main.go +++ /dev/null @@ -1,144 +0,0 @@ -package main - -import ( - _ "embed" - "fmt" - "os" - "time" - - "github.com/barelyhuman/commitlog/v3/commands" - "github.com/urfave/cli/v2" -) - -//go:embed .commitlog.release -var version string - -func main() { - app := &cli.App{ - Name: "commitlog", - Usage: "commits to changelogs", - CommandNotFound: cli.ShowCommandCompletions, - Action: func(c *cli.Context) error { - fmt.Println( - "[commitlog] we no longer support direct invocation, please use the subcommand `generate` to generate a log or `release` to manage your .commitlog.release", - ) - - return nil - }, - Version: version, - Compiled: time.Now(), - HideVersion: false, - Commands: []*cli.Command{ - { - Name: "generate", - Aliases: []string{"g"}, - Usage: "commits to changelogs", - Action: func(c *cli.Context) error { - return commands.Commitlog(c) - }, - Flags: []cli.Flag{ - &cli.StringFlag{ - Name: "path", - Value: ".", - Aliases: []string{"p"}, - Usage: "root with the '.git' folder `PATH`", - }, - &cli.BoolFlag{ - Name: "promo", - Usage: "add promo text to the end of output", - }, - &cli.StringFlag{ - Name: "out", - Aliases: []string{"o"}, - Usage: "path to the output `FILE`", - }, - &cli.BoolFlag{ - Name: "stdio", - Value: true, - Usage: "print to the stdout", - }, - &cli.StringFlag{ - Name: "categories", - Value: "", - Usage: "categories to use, includes all commits by default. any text you add here will be used to create categories out of the commits", - }, - &cli.StringFlag{ - Name: "start", - Aliases: []string{"s"}, - Usage: "`START` reference for the commit to include commits from," + - "This is inclusive of the given commit reference", - }, - &cli.StringFlag{ - Name: "end", - Aliases: []string{"e"}, - Usage: "`END` reference for the commit to stop including commits at." + - "This is exclusive of the given commit reference", - }, - }, - }, - { - Name: "release", - Aliases: []string{"r"}, - Usage: "manage .commitlog.release version", - Action: func(c *cli.Context) error { - return commands.Release(c) - }, - Flags: []cli.Flag{ - &cli.BoolFlag{ - Name: "init", - Value: false, - Usage: "initialise commitlog release", - }, - &cli.StringFlag{ - Name: "path", - Value: ".", - Aliases: []string{"p"}, - Usage: "`PATH` to a folder where .commitlog.release exists or is to be created." + - "(note: do not use `--commit` or `--push` if the file isn't in the root)", - }, - &cli.BoolFlag{ - Name: "pre", - Value: false, - Usage: "create a pre-release version. will default to patch increment unless" + - "specified and not already a pre-release", - }, - &cli.StringFlag{ - Name: "pre-tag", - Value: "beta", - Usage: "create a pre-release version", - }, - &cli.BoolFlag{ - Name: "major", - Value: false, - Usage: "create a major version", - }, - &cli.BoolFlag{ - Name: "minor", - Value: false, - Usage: "create a minor version", - }, - &cli.BoolFlag{ - Name: "patch", - Value: false, - Usage: "create a patch version", - }, - &cli.BoolFlag{ - Name: "commit", - Value: false, - Usage: "if true will create a commit and tag, of the changed version", - }, - &cli.BoolFlag{ - Name: "push", - Value: false, - Usage: "if true will create push the created release commit + tag on origin", - }, - }, - }, - }, - } - - err := app.Run(os.Args) - if err != nil { - fmt.Fprintf(os.Stderr, "[commitlog] %v", err) - } -} diff --git a/manual.html b/manual.html new file mode 100644 index 0000000..da8515c --- /dev/null +++ b/manual.html @@ -0,0 +1,257 @@ +
+Codestin Search App + + +

commitlog

+

Home Manual Download API

+

Manual

+ +

Basics

+

commitlog come with 2 basic functionalities

+ +

Both the above are available as sub commands and we'll go through each one by +one.

+

Just running commitlog no longer works as it did in v1, you'll need to specify +a sub command to get it working.

+

This has been done to keep it simpler to keep arbitrary behaviour to a minimum

+

generate

+

The first one is generate and in most cases you'll just be using this to +handle generation of commits as a list of markdown notes

+

Here's an example of what it'll look like to run the generate sub-command

+
$ commitlog generate
+# or 
+$ commitlog g
+
+

Output:

+
## All Changes
+87ce3fc76b252908cdd81f9537713f8d67813652 chore: v2.0.0-beta.0
+
+09fc85c0d1d52d770bbbf39ac45907103a53d354 refactor: swap go-git for push with exec
+
+5bafe9d105298001707c7c816e60d3ef0257a816 fix: tag creation
+
+909fd032facdeb4fb7633a4fad82dced28e8de83 chore: swap debugging logger with stderr printer
+<!-- .... more commits till the end of tag -->
+
+

The behaviour of the generate command is like so

+ +

The default behaviour of commitlog is to print to the stdout of your +terminal which might not be what you wish to do.

+

So, if you wish to ever write to a file , you can use the --out FILE flag to +write the output to a file instead.

+
$ commitlog g -o ./CHANGELOG.md
+
+
+

Note: commitlog will overwrite the file with the new output, make sure you +create a backup of the file when working with this.

+
+
+

Note: In coming versions an append mode will be added to the CLI to avoid +having to deal with this manually

+
+

release

+

The release sub-command is a complimentary sub-command added to commitlog to +help you with managing release versions. I understand that most languages have +their own package version management and you might want to work with them but +that's also why the release sub-command isn't something you need, it's there +for cases where you might wanna use it.

+

My primary usecase is when working with repositories that work with multiple +languages and I'd prefer a unified version.

+

The release command doesn't modify your source code files but instead handles +the version with it's own file named .commitlog.release, which just holds the +version number right now and while this does have the X.X.X format (semantic +versioning format) the increments or how you handle them doesn't have to be.

+

The command is flexible enough for you to combine and create your own way of +versioning.

+
Initialize
+
$ commitlog release --init
+# or 
+$ commitlog r --init
+
+

Once initialized, you'll see a .commitlog.release file in your repo with the +version v0.0.0 to start with.

+
Increments
+

Post that you can use the remaining flags to help you incrementing the version +as needed.

+
$ commitlog r --major # change to v1.0.0
+$ commitlog r --minor # change to v0.1.0
+$ commitlog r --patch # change to v0.0.1
+$ commitlog r --pre # change to v0.0.0-beta.0
+$ commitlog r --pre --pre-tag="dev" # change to v0.0.0-dev.0
+
+# or go bonkers 
+$ commitlog r --patch --pre --pre-tag="dev" # change to v0.0.1-dev.0
+$ commitlog r --major --patch --pre --pre-tag="dev" # change to v1.0.1-dev.0
+
+

Git actions

+

Most times you'd also want a tool like this to create commits and tags for you +which is fair, so release does come with a few git actions.

+ +

The whole command would look a little something like this

+
$ commitlog r --patch --commit --push
+
+

Advanced

+

These are not really hard to guess or achieve but are in the advanced section as +this isn't something a beginner user might need to mess with. If you have other +use cases that you feel like should be added here, raise a issue.

+

Selective Log Ranges

+There's enough cases where the entire history between the tags makes no sense. You might just want a specific set of commits and this is very easy to do with commitlog +
$ commitlog g --start HEAD --end HEAD~3 
+# would return the last 3 commits
+
+

And as you might have understood, commitlog does work with git's revision system +so you can reuse git's own revision pointers as needed. Though it's mostly +easier to just use the HASH since, finding the hashes in git log is easier +than finding the number you have to type after the HEAD~

+

From a different repo

+A lot more often you might need to generate logs for a sub-repo when working with a huge multirepo folder which a lot of sub-modules and switching worktree for the changelog might not be something you wish to do. +

In cases like these the -p or --path flag can be used with the generate +flag

+
$ commitlog g -p ./sub/module -s HEAD~3 
+# would return the commits from HEAD~3 to the next tag or end of all commits.
+
+

Categorize

+You wouldn't be using commitlog otherwise so this obviously has to exist. +

As for why is this turned off by default? I just don't use commit standards and +mostly just need the commits between tags and very rarely need the categories to +help me but doesn't change the fact that someone else might need it.

+

So, how does commitlog categorize? using regex's , or more like comma seperated +regex's.

+

The implementation approach might bring some issue but I'm going to wait for +them instead of over fixing something that might never really happen.

+

Anyway, a simple example for a non-scoped commitlint styled categorization would +look something like this .

+
$ commitlog g --categories="feat:,fix:"
+
+

Output:

+
## feat:
+110c9b260e6de1e2be9af28b3592c373ab6fc501 feat: handling for pre increment
+
+9080580575d3579b3d11dd114830eb128f0c8130 feat: releaser base maj,min,patch setup
+
+b513e53cbbc30e5b667fbba373b9589911a47ac0 feat: generator subcommand implementation
+
+## fix:
+5bafe9d105298001707c7c816e60d3ef0257a816 fix: tag creation
+
+

This could be made a little more neater using a better regex like so

+
$ commitlog g --categories="^feat,^fix"
+
+

Output:

+
## ^feat
+e0ce9c693c554158b7b4841b799524164d9c3e83 feat(releaser): add init and pre-tag handlers
+
+110c9b260e6de1e2be9af28b3592c373ab6fc501 feat: handling for pre increment
+
+9080580575d3579b3d11dd114830eb128f0c8130 feat: releaser base maj,min,patch setup
+
+b513e53cbbc30e5b667fbba373b9589911a47ac0 feat: generator subcommand implementation
+
+## ^fix
+5bafe9d105298001707c7c816e60d3ef0257a816 fix: tag creation
+
+540bb3d7419aab314fdb999dd57eeac3c53f5fad fix doc generation
+
+87d40ddbd463ad71b3af8b7edb8ac8176ecbf2f5 fix tests for new param
+
+

As visible, you find more commits in the 2nd one since the regex matches more +cases and gives you more information. You are free to modify these to make them +work with other patterns that you might follow.

+

Also the titles are going to be the regex's you pass. A future version will add +a way for you to add label's to the regex though that's a little harder to +achieve without making the flags very verbose so I've avoided it for now.

+
+

Note: This is the initial implementation of this and might change in a +future major version since this flag feels a little more frictional than the +other approaches I have in mind. Feel free to recommend other ways to do this.

+
+

CLI

+

This is the entire CLI reference, which you can also access by using the -h +flag on the downloaded binary.

+

commitlog -h

+
NAME:
+   commitlog - commits to changelogs
+
+USAGE:
+   commitlog [global options] command [command options] [arguments...]
+
+COMMANDS:
+   generate, g  commits to changelogs
+   release, r   manage .commitlog.release version
+   help, h      Shows a list of commands or help for one command
+
+GLOBAL OPTIONS:
+   --help, -h  show help (default: false)
+
+
+

commitlog g -h

+
NAME:
+   commitlog generate - commits to changelogs
+
+USAGE:
+   commitlog generate [command options] [arguments...]
+
+OPTIONS:
+   --categories value       categories to use, includes all commits by default. any text you add here will be used to create categories out of the commits
+   --end END, -e END        END reference for the commit to stop including commits at.This is exclusive of the given commit reference
+   --out FILE, -o FILE      path to the output FILE
+   --path PATH, -p PATH     root with the '.git' folder PATH (default: ".")
+   --promo                  add promo text to the end of output (default: false)
+   --start START, -s START  START reference for the commit to include commits from,This is inclusive of the given commit reference
+   --stdio                  print to the stdout (default: true)
+
+
+

commitlog r -h

+
NAME:
+   commitlog release - manage .commitlog.release version
+
+USAGE:
+   commitlog release [command options] [arguments...]
+
+OPTIONS:
+   --commit              if true will create a commit and tag, of the changed version (default: false)
+   --init                initialise commitlog release (default: false)
+   --major               create a major version (default: false)
+   --minor               create a minor version (default: false)
+   --patch               create a patch version (default: false)
+   --path PATH, -p PATH  PATH to a folder where .commitlog.release exists or is to be created.(note: do not use `--commit` or `--push` if the file isn't in the root) (default: ".")
+   --pre                 create a pre-release version. will default to patch increment unlessspecified and not already a pre-release (default: false)
+   --pre-tag value       create a pre-release version (default: "beta")
+   --push                if true will create push the created release commit + tag on origin (default: false)
+
+
\ No newline at end of file diff --git a/mudkip.js b/mudkip.js new file mode 100644 index 0000000..7c268e1 --- /dev/null +++ b/mudkip.js @@ -0,0 +1,2788 @@ +/* Generated by the Nim Compiler v1.6.4 */ +var framePtr = null; +var excHandler = 0; +var lastJSError = null; +var NTI469762054 = {size: 0, kind: 24, base: null, node: null, finalizer: null}; +var NTI469762052 = {size: 0, kind: 18, base: null, node: null, finalizer: null}; +var NTI469762053 = {size: 0, kind: 24, base: null, node: null, finalizer: null}; +var NTI687865917 = {size: 0, kind: 18, base: null, node: null, finalizer: null}; +var NTI1006632963 = {size: 0, kind: 17, base: null, node: null, finalizer: null}; +var NTI33554438 = {size: 0,kind: 2,base: null,node: null,finalizer: null}; +var NTI1006632964 = {size: 0, kind: 19, base: null, node: null, finalizer: null}; +var NTI33555124 = {size: 0, kind: 17, base: null, node: null, finalizer: null}; +var NTI33555114 = {size: 0, kind: 17, base: null, node: null, finalizer: null}; +var NTI33555125 = {size: 0, kind: 17, base: null, node: null, finalizer: null}; +var NTI872415304 = {size: 0,kind: 31,base: null,node: null,finalizer: null}; +var NTI872415311 = {size: 0, kind: 18, base: null, node: null, finalizer: null}; +var NTI33555121 = {size: 0, kind: 17, base: null, node: null, finalizer: null}; +var NTI469762051 = {size: 0, kind: 18, base: null, node: null, finalizer: null}; +var NTI33554466 = {size: 0,kind: 1,base: null,node: null,finalizer: null}; +var NTI33554456 = {size: 0,kind: 31,base: null,node: null,finalizer: null}; +var NTI620757006 = {size: 0, kind: 18, base: null, node: null, finalizer: null}; +var NTI33555128 = {size: 0, kind: 17, base: null, node: null, finalizer: null}; +var NTI33555130 = {size: 0, kind: 17, base: null, node: null, finalizer: null}; +var NTI33555083 = {size: 0, kind: 17, base: null, node: null, finalizer: null}; +var NTI33555165 = {size: 0, kind: 22, base: null, node: null, finalizer: null}; +var NTI33554439 = {size: 0,kind: 28,base: null,node: null,finalizer: null}; +var NTI33554440 = {size: 0,kind: 29,base: null,node: null,finalizer: null}; +var NTI33555164 = {size: 0, kind: 22, base: null, node: null, finalizer: null}; +var NTI33555112 = {size: 0, kind: 17, base: null, node: null, finalizer: null}; +var NTI33555113 = {size: 0, kind: 17, base: null, node: null, finalizer: null}; +var NTI33555120 = {size: 0, kind: 17, base: null, node: null, finalizer: null}; +var NTI33555122 = {size: 0, kind: 17, base: null, node: null, finalizer: null}; +var NNI33555122 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []}; +NTI33555122.node = NNI33555122; +var NNI33555120 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []}; +NTI33555120.node = NNI33555120; +var NNI33555113 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []}; +NTI33555113.node = NNI33555113; +NTI33555164.base = NTI33555112; +NTI33555165.base = NTI33555112; +var NNI33555112 = {kind: 2, len: 5, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "parent", len: 0, typ: NTI33555164, name: "parent", sons: null}, +{kind: 1, offset: "name", len: 0, typ: NTI33554440, name: "name", sons: null}, +{kind: 1, offset: "message", len: 0, typ: NTI33554439, name: "msg", sons: null}, +{kind: 1, offset: "trace", len: 0, typ: NTI33554439, name: "trace", sons: null}, +{kind: 1, offset: "up", len: 0, typ: NTI33555165, name: "up", sons: null}]}; +NTI33555112.node = NNI33555112; +var NNI33555083 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []}; +NTI33555083.node = NNI33555083; +NTI33555112.base = NTI33555083; +NTI33555113.base = NTI33555112; +NTI33555120.base = NTI33555113; +NTI33555122.base = NTI33555120; +var NNI33555130 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []}; +NTI33555130.node = NNI33555130; +NTI33555130.base = NTI33555113; +var NNI33555128 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []}; +NTI33555128.node = NNI33555128; +NTI33555128.base = NTI33555113; +var NNI620757006 = {kind: 2, len: 2, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "Field0", len: 0, typ: NTI33554456, name: "Field0", sons: null}, +{kind: 1, offset: "Field1", len: 0, typ: NTI33554466, name: "Field1", sons: null}]}; +NTI620757006.node = NNI620757006; +var NNI469762051 = {kind: 2, len: 4, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "element", len: 0, typ: NTI33554439, name: "element", sons: null}, +{kind: 1, offset: "slug", len: 0, typ: NTI33554439, name: "slug", sons: null}, +{kind: 1, offset: "count", len: 0, typ: NTI33554456, name: "count", sons: null}, +{kind: 1, offset: "score", len: 0, typ: NTI33554456, name: "score", sons: null}]}; +NTI469762051.node = NNI469762051; +var NNI33555121 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []}; +NTI33555121.node = NNI33555121; +NTI33555121.base = NTI33555120; +var NNI872415311 = {kind: 2, len: 2, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "a", len: 0, typ: NTI872415304, name: "a", sons: null}, +{kind: 1, offset: "b", len: 0, typ: NTI33554456, name: "b", sons: null}]}; +NTI872415311.node = NNI872415311; +var NNI33555125 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []}; +NTI33555125.node = NNI33555125; +var NNI33555114 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []}; +NTI33555114.node = NNI33555114; +NTI33555114.base = NTI33555112; +NTI33555125.base = NTI33555114; +var NNI33555124 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []}; +NTI33555124.node = NNI33555124; +NTI33555124.base = NTI33555113; +NTI1006632964.base = NTI33554438; +var NNI1006632963 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []}; +NTI1006632963.node = NNI1006632963; +NTI1006632963.base = NTI33555125; +var NNI687865917 = {kind: 2, len: 2, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "a", len: 0, typ: NTI33554456, name: "a", sons: null}, +{kind: 1, offset: "b", len: 0, typ: NTI33554456, name: "b", sons: null}]}; +NTI687865917.node = NNI687865917; +NTI469762053.base = NTI33554439; +var NNI469762052 = {kind: 2, len: 4, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "title", len: 0, typ: NTI33554439, name: "title", sons: null}, +{kind: 1, offset: "slug", len: 0, typ: NTI33554439, name: "slug", sons: null}, +{kind: 1, offset: "contentTokens", len: 0, typ: NTI469762053, name: "contentTokens", sons: null}, +{kind: 1, offset: "displayContent", len: 0, typ: NTI33554439, name: "displayContent", sons: null}]}; +NTI469762052.node = NNI469762052; +NTI469762054.base = NTI469762052; + +function makeNimstrLit(c_33556802) { + var result = []; + for (var i = 0; i < c_33556802.length; ++i) { + result[i] = c_33556802.charCodeAt(i); + } + return result; + + + +} + +function mnewString(len_33556894) { + return new Array(len_33556894); + + + +} + +function toJSStr(s_33556808) { + var Temporary5; + var Temporary7; + + var result_33556809 = null; + + var res_33556843 = newSeq_33556826((s_33556808).length); + var i_33556844 = 0; + var j_33556845 = 0; + Label1: do { + Label2: while (true) { + if (!(i_33556844 < (s_33556808).length)) break Label2; + var c_33556846 = s_33556808[i_33556844]; + if ((c_33556846 < 128)) { + res_33556843[j_33556845] = String.fromCharCode(c_33556846); + i_33556844 += 1; + } + else { + var helper_33556858 = newSeq_33556826(0); + Label3: do { + Label4: while (true) { + if (!true) break Label4; + var code_33556859 = c_33556846.toString(16); + if ((((code_33556859) == null ? 0 : (code_33556859).length) == 1)) { + helper_33556858.push("%0");; + } + else { + helper_33556858.push("%");; + } + + helper_33556858.push(code_33556859);; + i_33556844 += 1; + if (((s_33556808).length <= i_33556844)) Temporary5 = true; else { Temporary5 = (s_33556808[i_33556844] < 128); } if (Temporary5) { + break Label3; + } + + c_33556846 = s_33556808[i_33556844]; + } + } while (false); +++excHandler; + Temporary7 = framePtr; + try { + res_33556843[j_33556845] = decodeURIComponent(helper_33556858.join("")); +--excHandler; +} catch (EXCEPTION) { + var prevJSError = lastJSError; + lastJSError = EXCEPTION; + --excHandler; + framePtr = Temporary7; + res_33556843[j_33556845] = helper_33556858.join(""); + lastJSError = prevJSError; + } finally { + framePtr = Temporary7; + } + } + + j_33556845 += 1; + } + } while (false); + if (res_33556843.length < j_33556845) { for (var i = res_33556843.length ; i < j_33556845 ; ++i) res_33556843.push(null); } + else { res_33556843.length = j_33556845; }; + result_33556809 = res_33556843.join(""); + + return result_33556809; + +} + +function raiseException(e_33556668, ename_33556669) { + e_33556668.name = ename_33556669; + if ((excHandler == 0)) { + unhandledException(e_33556668); + } + + throw e_33556668; + + +} + +function addInt(a_33556941, b_33556942) { + var result = a_33556941 + b_33556942; + checkOverflowInt(result); + return result; + + + +} + +function chckRange(i_33557190, a_33557191, b_33557192) { + var Temporary1; + + var result_33557193 = 0; + + BeforeRet: do { + if (!(a_33557191 <= i_33557190)) Temporary1 = false; else { Temporary1 = (i_33557190 <= b_33557192); } if (Temporary1) { + result_33557193 = i_33557190; + break BeforeRet; + } + else { + raiseRangeError(); + } + + } while (false); + + return result_33557193; + +} + +function setConstr() { + var result = {}; + for (var i = 0; i < arguments.length; ++i) { + var x = arguments[i]; + if (typeof(x) == "object") { + for (var j = x[0]; j <= x[1]; ++j) { + result[j] = true; + } + } else { + result[x] = true; + } + } + return result; + + + +} +var ConstSet1 = setConstr(17, 16, 4, 18, 27, 19, 23, 22, 21); + +function nimCopy(dest_33557141, src_33557142, ti_33557143) { + var result_33557152 = null; + + switch (ti_33557143.kind) { + case 21: + case 22: + case 23: + case 5: + if (!(isFatPointer_33557132(ti_33557143))) { + result_33557152 = src_33557142; + } + else { + result_33557152 = [src_33557142[0], src_33557142[1]]; + } + + break; + case 19: + if (dest_33557141 === null || dest_33557141 === undefined) { + dest_33557141 = {}; + } + else { + for (var key in dest_33557141) { delete dest_33557141[key]; } + } + for (var key in src_33557142) { dest_33557141[key] = src_33557142[key]; } + result_33557152 = dest_33557141; + + break; + case 18: + case 17: + if (!((ti_33557143.base == null))) { + result_33557152 = nimCopy(dest_33557141, src_33557142, ti_33557143.base); + } + else { + if ((ti_33557143.kind == 17)) { + result_33557152 = (dest_33557141 === null || dest_33557141 === undefined) ? {m_type: ti_33557143} : dest_33557141; + } + else { + result_33557152 = (dest_33557141 === null || dest_33557141 === undefined) ? {} : dest_33557141; + } + } + nimCopyAux(result_33557152, src_33557142, ti_33557143.node); + break; + case 24: + case 4: + case 27: + case 16: + if (src_33557142 === null) { + result_33557152 = null; + } + else { + if (dest_33557141 === null || dest_33557141 === undefined || dest_33557141.length != src_33557142.length) { + dest_33557141 = new Array(src_33557142.length); + } + result_33557152 = dest_33557141; + for (var i = 0; i < src_33557142.length; ++i) { + result_33557152[i] = nimCopy(result_33557152[i], src_33557142[i], ti_33557143.base); + } + } + + break; + case 28: + if (src_33557142 !== null) { + result_33557152 = src_33557142.slice(0); + } + + break; + default: + result_33557152 = src_33557142; + break; + } + + return result_33557152; + +} + +function chckIndx(i_33557185, a_33557186, b_33557187) { + var Temporary1; + + var result_33557188 = 0; + + BeforeRet: do { + if (!(a_33557186 <= i_33557185)) Temporary1 = false; else { Temporary1 = (i_33557185 <= b_33557187); } if (Temporary1) { + result_33557188 = i_33557185; + break BeforeRet; + } + else { + raiseIndexError(i_33557185, a_33557186, b_33557187); + } + + } while (false); + + return result_33557188; + +} + +function nimMax(a_33556999, b_33557000) { + var Temporary1; + + var result_33557001 = 0; + + BeforeRet: do { + if ((b_33557000 <= a_33556999)) { + Temporary1 = a_33556999; + } + else { + Temporary1 = b_33557000; + } + + result_33557001 = Temporary1; + break BeforeRet; + } while (false); + + return result_33557001; + +} + +function subInt(a_33556945, b_33556946) { + var result = a_33556945 - b_33556946; + checkOverflowInt(result); + return result; + + + +} + +function nimMin(a_33556995, b_33556996) { + var Temporary1; + + var result_33556997 = 0; + + BeforeRet: do { + if ((a_33556995 <= b_33556996)) { + Temporary1 = a_33556995; + } + else { + Temporary1 = b_33556996; + } + + result_33556997 = Temporary1; + break BeforeRet; + } while (false); + + return result_33556997; + +} +var ConstSet2 = setConstr([65, 90]); +var ConstSet3 = setConstr(95, 32, 46); +var ConstSet4 = setConstr(95, 32, 46); + +function mulInt(a_33556949, b_33556950) { + var result = a_33556949 * b_33556950; + checkOverflowInt(result); + return result; + + + +} +var ConstSet5 = setConstr([97, 122]); +var ConstSet6 = setConstr([65, 90], [97, 122]); +var ConstSet7 = setConstr([97, 122]); +var ConstSet8 = setConstr([65, 90]); +var ConstSet9 = setConstr([65, 90], [97, 122]); + +function eqStrings(a_33556932, b_33556933) { + if (a_33556932 == b_33556933) return true; + if (a_33556932 === null && b_33556933.length == 0) return true; + if (b_33556933 === null && a_33556932.length == 0) return true; + if ((!a_33556932) || (!b_33556933)) return false; + var alen = a_33556932.length; + if (alen != b_33556933.length) return false; + for (var i = 0; i < alen; ++i) + if (a_33556932[i] != b_33556933[i]) return false; + return true; + + + +} +var ConstSet10 = setConstr(60, 62, 94); +var ConstSet11 = setConstr(60, 62, 94); +var ConstSet12 = setConstr(45, 43, 32); +var ConstSet13 = setConstr([48, 57]); +var ConstSet14 = setConstr([48, 57]); +var ConstSet15 = setConstr([48, 57]); + +function divInt(a_33556953, b_33556954) { + if (b_33556954 == 0) raiseDivByZero(); + if (b_33556954 == -1 && a_33556953 == 2147483647) raiseOverflow(); + return Math.trunc(a_33556953 / b_33556954); + + + +} +var ConstSet16 = setConstr([65, 90], [97, 122]); + +function nimCharToStr(x_33556518) { + var result_33556519 = []; + + result_33556519 = nimCopy(null, mnewString(1), NTI33554439); + result_33556519[0] = x_33556518; + + return result_33556519; + +} + +function addChar(x_33557256, c_33557257) { + x_33557256.push(c_33557257); + + +} + +function rawEcho() { + var buf = ""; + for (var i = 0; i < arguments.length; ++i) { + buf += toJSStr(arguments[i]); + } + console.log(buf); + + + +} + +function cstrToNimstr(c_33556805) { + var ln = c_33556805.length; + var result = new Array(ln); + var r = 0; + for (var i = 0; i < ln; ++i) { + var ch = c_33556805.charCodeAt(i); + + if (ch < 128) { + result[r] = ch; + } + else { + if (ch < 2048) { + result[r] = (ch >> 6) | 192; + } + else { + if (ch < 55296 || ch >= 57344) { + result[r] = (ch >> 12) | 224; + } + else { + ++i; + ch = 65536 + (((ch & 1023) << 10) | (c_33556805.charCodeAt(i) & 1023)); + result[r] = (ch >> 18) | 240; + ++r; + result[r] = ((ch >> 12) & 63) | 128; + } + ++r; + result[r] = ((ch >> 6) & 63) | 128; + } + ++r; + result[r] = (ch & 63) | 128; + } + ++r; + } + return result; + + + +} +var ConstSet17 = setConstr(32, 10, 9, 13); + var whiteSpace_1006632971 = nimCopy(null, ConstSet17, NTI1006632964); +var ConstSet18 = setConstr(120, 88); +if (!Math.trunc) { + Math.trunc = function(v) { + v = +v; + if (!isFinite(v)) return v; + return (v - v % 1) || (v < 0 ? -0 : v === 0 ? v : 0); + }; +} + +var objectID_1056964770 = [0]; +var searchDB_469762065 = [[]]; + +function add_33556420(x_33556421, x_33556421_Idx, y_33556422) { + if (x_33556421[x_33556421_Idx] === null) { x_33556421[x_33556421_Idx] = []; } + var off = x_33556421[x_33556421_Idx].length; + x_33556421[x_33556421_Idx].length += y_33556422.length; + for (var i = 0; i < y_33556422.length; ++i) { + x_33556421[x_33556421_Idx][off+i] = y_33556422.charCodeAt(i); + } + + + +} + +function newSeq_33556826(len_33556828) { + var result_33556829 = []; + + result_33556829 = new Array(len_33556828); for (var i = 0 ; i < len_33556828 ; ++i) { result_33556829[i] = null; } + return result_33556829; + +} + +function unhandledException(e_33556664) { + var buf_33556665 = [[]]; + if (!(((e_33556664.message).length == 0))) { + buf_33556665[0].push.apply(buf_33556665[0], makeNimstrLit("Error: unhandled exception: "));; + buf_33556665[0].push.apply(buf_33556665[0], e_33556664.message);; + } + else { + buf_33556665[0].push.apply(buf_33556665[0], makeNimstrLit("Error: unhandled exception"));; + } + + buf_33556665[0].push.apply(buf_33556665[0], makeNimstrLit(" ["));; + add_33556420(buf_33556665, 0, e_33556664.name); + buf_33556665[0].push.apply(buf_33556665[0], makeNimstrLit("]\x0A"));; + var cbuf_33556666 = toJSStr(buf_33556665[0]); + framePtr = null; + if (typeof(Error) !== "undefined") { + throw new Error(cbuf_33556666); + } + else { + throw cbuf_33556666; + } + + + +} + +function raiseOverflow() { + raiseException({message: makeNimstrLit("over- or underflow"), parent: null, m_type: NTI33555122, name: null, trace: [], up: null}, "OverflowDefect"); + + +} + +function checkOverflowInt(a_33556939) { + if (a_33556939 > 2147483647 || a_33556939 < -2147483648) raiseOverflow(); + + + +} + +function raiseRangeError() { + raiseException({message: makeNimstrLit("value out of range"), parent: null, m_type: NTI33555130, name: null, trace: [], up: null}, "RangeDefect"); + + +} + +function addChars_251658415(result_251658417, result_251658417_Idx, x_251658418, start_251658419, n_251658420) { + var old_251658421 = (result_251658417[result_251658417_Idx]).length; + (result_251658417[result_251658417_Idx].length = chckRange(addInt(old_251658421, n_251658420), 0, 2147483647)); + Label1: do { + var iHEX60gensym4_251658435 = 0; + var i_469762383 = 0; + Label2: do { + Label3: while (true) { + if (!(i_469762383 < n_251658420)) break Label3; + iHEX60gensym4_251658435 = i_469762383; + result_251658417[result_251658417_Idx][chckIndx(addInt(old_251658421, iHEX60gensym4_251658435), 0, (result_251658417[result_251658417_Idx]).length - 1)] = x_251658418.charCodeAt(chckIndx(addInt(start_251658419, iHEX60gensym4_251658435), 0, (x_251658418).length - 1)); + i_469762383 = addInt(i_469762383, 1); + } + } while (false); + } while (false); + + +} + +function addChars_251658411(result_251658413, result_251658413_Idx, x_251658414) { + addChars_251658415(result_251658413, result_251658413_Idx, x_251658414, 0, ((x_251658414) == null ? 0 : (x_251658414).length)); + + +} + +function addInt_251658436(result_251658437, result_251658437_Idx, x_251658438) { + addChars_251658411(result_251658437, result_251658437_Idx, ((x_251658438) + "")); + + +} + +function addInt_251658457(result_251658458, result_251658458_Idx, x_251658459) { + addInt_251658436(result_251658458, result_251658458_Idx, x_251658459); + + +} + +function HEX24_335544323(x_335544324) { + var result_335544325 = [[]]; + + addInt_251658457(result_335544325, 0, x_335544324); + + return result_335544325[0]; + +} + +function isFatPointer_33557132(ti_33557133) { + var result_33557134 = false; + + BeforeRet: do { + result_33557134 = !((ConstSet1[ti_33557133.base.kind] != undefined)); + break BeforeRet; + } while (false); + + return result_33557134; + +} + +function nimCopyAux(dest_33557145, src_33557146, n_33557147) { + switch (n_33557147.kind) { + case 0: + break; + case 1: + dest_33557145[n_33557147.offset] = nimCopy(dest_33557145[n_33557147.offset], src_33557146[n_33557147.offset], n_33557147.typ); + + break; + case 2: + for (var i = 0; i < n_33557147.sons.length; i++) { + nimCopyAux(dest_33557145, src_33557146, n_33557147.sons[i]); + } + + break; + case 3: + dest_33557145[n_33557147.offset] = nimCopy(dest_33557145[n_33557147.offset], src_33557146[n_33557147.offset], n_33557147.typ); + for (var i = 0; i < n_33557147.sons.length; ++i) { + nimCopyAux(dest_33557145, src_33557146, n_33557147.sons[i][1]); + } + + break; + } + + +} + +function raiseIndexError(i_33556755, a_33556756, b_33556757) { + var Temporary1; + + if ((b_33556757 < a_33556756)) { + Temporary1 = makeNimstrLit("index out of bounds, the container is empty"); + } + else { + Temporary1 = (makeNimstrLit("index ") || []).concat(HEX24_335544323(i_33556755) || [],makeNimstrLit(" not in ") || [],HEX24_335544323(a_33556756) || [],makeNimstrLit(" .. ") || [],HEX24_335544323(b_33556757) || []); + } + + raiseException({message: nimCopy(null, Temporary1, NTI33554439), parent: null, m_type: NTI33555128, name: null, trace: [], up: null}, "IndexDefect"); + + +} + +function nsuFindChar(s_637535733, sub_637535734, start_637535735, last_637535736) { + var Temporary1; + + var result_637535737 = 0; + + BeforeRet: do { + if ((last_637535736 == 0)) { + Temporary1 = (s_637535733).length - 1; + } + else { + Temporary1 = last_637535736; + } + + var last_637535738 = Temporary1; + Label2: do { + var i_637535748 = 0; + var colontmp__469762394 = 0; + colontmp__469762394 = start_637535735; + var res_469762395 = colontmp__469762394; + Label3: do { + Label4: while (true) { + if (!(res_469762395 <= last_637535738)) break Label4; + i_637535748 = res_469762395; + if ((sub_637535734 == s_637535733[chckIndx(i_637535748, 0, (s_637535733).length - 1)])) { + result_637535737 = i_637535748; + break BeforeRet; + } + + res_469762395 = addInt(res_469762395, 1); + } + } while (false); + } while (false); + result_637535737 = -1; + break BeforeRet; + } while (false); + + return result_637535737; + +} + +function substr_33557907(s_33557908, first_33557909, last_33557910) { + var result_33557911 = []; + + var first_33557912 = nimMax(first_33557909, 0); + var L_33557913 = nimMax(addInt(subInt(nimMin(last_33557910, (s_33557908).length - 1), first_33557912), 1), 0); + result_33557911 = nimCopy(null, mnewString(chckRange(L_33557913, 0, 2147483647)), NTI33554439); + Label1: do { + var i_33557918 = 0; + var colontmp__469762398 = 0; + colontmp__469762398 = subInt(L_33557913, 1); + var res_469762399 = 0; + Label2: do { + Label3: while (true) { + if (!(res_469762399 <= colontmp__469762398)) break Label3; + i_33557918 = res_469762399; + result_33557911[chckIndx(i_33557918, 0, (result_33557911).length - 1)] = s_33557908[chckIndx(addInt(i_33557918, first_33557912), 0, (s_33557908).length - 1)]; + res_469762399 = addInt(res_469762399, 1); + } + } while (false); + } while (false); + + return result_33557911; + +} + +function substr_33557919(s_33557920, first_33557921) { + var result_33557922 = []; + + result_33557922 = nimCopy(null, substr_33557907(s_33557920, first_33557921, (s_33557920).length - 1), NTI33554439); + + return result_33557922; + +} + +function fill_637535675(a_637535677, value_637535678) { + var xHEX60gensym166_637535684 = 0; + Label1: do { + Label2: while (true) { + if (!(xHEX60gensym166_637535684 <= (a_637535677).length - 1)) break Label2; + a_637535677[chckIndx(xHEX60gensym166_637535684, 0, (a_637535677).length - 1)] = value_637535678; + xHEX60gensym166_637535684 = addInt(xHEX60gensym166_637535684, 1); + } + } while (false); + + +} + +function nsuInitSkipTable(a_637535672, sub_637535673) { + var m_637535674 = (sub_637535673).length; + fill_637535675(a_637535672, m_637535674); + Label1: do { + var i_637535693 = 0; + var colontmp__469762402 = 0; + colontmp__469762402 = subInt(m_637535674, 1); + var i_469762403 = 0; + Label2: do { + Label3: while (true) { + if (!(i_469762403 < colontmp__469762402)) break Label3; + i_637535693 = i_469762403; + a_637535672[chckIndx(sub_637535673[chckIndx(i_637535693, 0, (sub_637535673).length - 1)], 0, (a_637535672).length - 1)] = subInt(subInt(m_637535674, 1), i_637535693); + i_469762403 = addInt(i_469762403, 1); + } + } while (false); + } while (false); + + +} + +function nsuFindStrA(a_637535713, s_637535714, sub_637535715, start_637535716, last_637535717) { + var Temporary1; + + var result_637535718 = 0; + + BeforeRet: do { + if ((last_637535717 == 0)) { + Temporary1 = (s_637535714).length - 1; + } + else { + Temporary1 = last_637535717; + } + + var last_637535719 = Temporary1; + var subLast_637535720 = subInt((sub_637535715).length, 1); + if ((subLast_637535720 == -1)) { + result_637535718 = start_637535716; + break BeforeRet; + } + + var skip_637535721 = start_637535716; + Label2: do { + Label3: while (true) { + if (!(subLast_637535720 <= subInt(last_637535719, skip_637535721))) break Label3; + var i_637535722 = subLast_637535720; + Label4: do { + Label5: while (true) { + if (!(s_637535714[chckIndx(addInt(skip_637535721, i_637535722), 0, (s_637535714).length - 1)] == sub_637535715[chckIndx(i_637535722, 0, (sub_637535715).length - 1)])) break Label5; + if ((i_637535722 == 0)) { + result_637535718 = skip_637535721; + break BeforeRet; + } + + i_637535722 = subInt(i_637535722, 1); + } + } while (false); + skip_637535721 = addInt(skip_637535721, a_637535713[chckIndx(s_637535714[chckIndx(addInt(skip_637535721, subLast_637535720), 0, (s_637535714).length - 1)], 0, (a_637535713).length - 1)]); + } + } while (false); + result_637535718 = -1; + break BeforeRet; + } while (false); + + return result_637535718; + +} + +function nsuReplaceStr(s_637535904, sub_637535905, by_637535906) { + var result_637535907 = []; + + result_637535907 = nimCopy(null, [], NTI33554439); + var subLen_637535908 = (sub_637535905).length; + if ((subLen_637535908 == 0)) { + result_637535907 = nimCopy(null, s_637535904, NTI33554439); + } + else { + if ((subLen_637535908 == 1)) { + var c_637535909 = sub_637535905[chckIndx(0, 0, (sub_637535905).length - 1)]; + var last_637535910 = (s_637535904).length - 1; + var i_637535911 = 0; + Label1: do { + Label2: while (true) { + if (!true) break Label2; + var j_637535912 = nsuFindChar(s_637535904, c_637535909, chckRange(i_637535911, 0, 2147483647), last_637535910); + if ((j_637535912 < 0)) { + break Label1; + } + + result_637535907.push.apply(result_637535907, substr_33557907(s_637535904, i_637535911, subInt(j_637535912, 1)));; + result_637535907.push.apply(result_637535907, by_637535906);; + i_637535911 = addInt(j_637535912, subLen_637535908); + } + } while (false); + result_637535907.push.apply(result_637535907, substr_33557919(s_637535904, i_637535911));; + } + else { + var a_637535913 = [new Int32Array(256)]; + nsuInitSkipTable(a_637535913[0], sub_637535905); + var last_637535914 = (s_637535904).length - 1; + var i_637535915 = 0; + Label3: do { + Label4: while (true) { + if (!true) break Label4; + var j_637535916 = nsuFindStrA(a_637535913[0], s_637535904, sub_637535905, chckRange(i_637535915, 0, 2147483647), last_637535914); + if ((j_637535916 < 0)) { + break Label3; + } + + result_637535907.push.apply(result_637535907, substr_33557907(s_637535904, i_637535915, subInt(j_637535916, 1)));; + result_637535907.push.apply(result_637535907, by_637535906);; + i_637535915 = addInt(j_637535916, subLen_637535908); + } + } while (false); + result_637535907.push.apply(result_637535907, substr_33557919(s_637535904, i_637535915));; + } + } + + return result_637535907; + +} + +function nsuToLowerAsciiChar(c_637534276) { + var result_637534277 = 0; + + if ((ConstSet2[c_637534276] != undefined)) { + result_637534277 = (c_637534276 ^ 32); + } + else { + result_637534277 = c_637534276; + } + + + return result_637534277; + +} + +function fuzzyMatch_620757008(pattern_620757009, str_620757010) { + var Temporary4; + var Temporary5; + var Temporary6; + var Temporary7; + var Temporary8; + + var result_620757013 = {Field0: 0, Field1: false}; + + var scoreState_620757014 = -100; + var headerMatched_620757015 = false; + var unmatchedLeadingCharCount_620757016 = 0; + var consecutiveMatchCount_620757017 = 0; + var strIndex_620757018 = 0; + var patIndex_620757019 = 0; + var score_620757020 = 0; + Label1: do { + Label2: while (true) { + if (!((strIndex_620757018 < ((str_620757010) == null ? 0 : (str_620757010).length)) && (patIndex_620757019 < ((pattern_620757009) == null ? 0 : (pattern_620757009).length)))) break Label2; + Label3: do { + var patternChar_620757023 = nsuToLowerAsciiChar(pattern_620757009.charCodeAt(chckIndx(patIndex_620757019, 0, (pattern_620757009).length - 1))); + var strChar_620757024 = nsuToLowerAsciiChar(str_620757010.charCodeAt(chckIndx(strIndex_620757018, 0, (str_620757010).length - 1))); + if ((ConstSet3[patternChar_620757023] != undefined)) { + patIndex_620757019 = addInt(patIndex_620757019, 1); + break Label3; + } + + if ((ConstSet4[strChar_620757024] != undefined)) { + strIndex_620757018 = addInt(strIndex_620757018, 1); + break Label3; + } + + if ((!(headerMatched_620757015) && (strChar_620757024 == 58))) { + headerMatched_620757015 = true; + scoreState_620757014 = -100; + score_620757020 = ((Math.floor((0.5 * score_620757020))) | 0); + patIndex_620757019 = 0; + strIndex_620757018 = addInt(strIndex_620757018, 1); + break Label3; + } + + if ((strChar_620757024 == patternChar_620757023)) { + switch (scoreState_620757014) { + case -100: + case 20: + scoreState_620757014 = 10; + break; + case 0: + scoreState_620757014 = 5; + score_620757020 = addInt(score_620757020, scoreState_620757014); + break; + case 10: + case 5: + consecutiveMatchCount_620757017 = addInt(consecutiveMatchCount_620757017, 1); + scoreState_620757014 = 5; + score_620757020 = addInt(score_620757020, mulInt(5, consecutiveMatchCount_620757017)); + if ((scoreState_620757014 == 10)) { + score_620757020 = addInt(score_620757020, 10); + } + + var onBoundary_620757076 = (patIndex_620757019 == ((pattern_620757009) == null ? -1 : (pattern_620757009).length - 1)); + if ((!(onBoundary_620757076) && (strIndex_620757018 < ((str_620757010) == null ? -1 : (str_620757010).length - 1)))) { + var nextPatternChar_620757077 = nsuToLowerAsciiChar(pattern_620757009.charCodeAt(chckIndx(addInt(patIndex_620757019, 1), 0, (pattern_620757009).length - 1))); + var nextStrChar_620757078 = nsuToLowerAsciiChar(str_620757010.charCodeAt(chckIndx(addInt(strIndex_620757018, 1), 0, (str_620757010).length - 1))); + if (!!((ConstSet5[nextStrChar_620757078] != undefined))) Temporary4 = false; else { Temporary4 = !((nextStrChar_620757078 == nextPatternChar_620757077)); } onBoundary_620757076 = Temporary4; + } + + if (onBoundary_620757076) { + scoreState_620757014 = 20; + score_620757020 = addInt(score_620757020, scoreState_620757014); + } + + break; + case -1: + case -3: + if (!((ConstSet6[str_620757010.charCodeAt(chckIndx(subInt(strIndex_620757018, 1), 0, (str_620757010).length - 1))] != undefined))) Temporary5 = true; else { if (!(ConstSet7[str_620757010.charCodeAt(chckIndx(subInt(strIndex_620757018, 1), 0, (str_620757010).length - 1))] != undefined)) Temporary6 = false; else { Temporary6 = (ConstSet8[str_620757010.charCodeAt(chckIndx(strIndex_620757018, 0, (str_620757010).length - 1))] != undefined); } Temporary5 = Temporary6; } var isLeadingChar_620757102 = Temporary5; + if (isLeadingChar_620757102) { + scoreState_620757014 = 10; + } + else { + scoreState_620757014 = 0; + score_620757020 = addInt(score_620757020, scoreState_620757014); + } + + break; + } + patIndex_620757019 = addInt(patIndex_620757019, 1); + } + else { + switch (scoreState_620757014) { + case -100: + scoreState_620757014 = -3; + score_620757020 = addInt(score_620757020, scoreState_620757014); + break; + case 5: + scoreState_620757014 = -1; + score_620757020 = addInt(score_620757020, scoreState_620757014); + consecutiveMatchCount_620757017 = 0; + break; + case -3: + if ((unmatchedLeadingCharCount_620757016 < 3)) { + scoreState_620757014 = -3; + score_620757020 = addInt(score_620757020, scoreState_620757014); + } + + unmatchedLeadingCharCount_620757016 = addInt(unmatchedLeadingCharCount_620757016, 1); + break; + default: + scoreState_620757014 = -1; + score_620757020 = addInt(score_620757020, scoreState_620757014); + break; + } + } + + strIndex_620757018 = addInt(strIndex_620757018, 1); + } while (false); + } + } while (false); + if (!(patIndex_620757019 == ((pattern_620757009) == null ? 0 : (pattern_620757009).length))) Temporary7 = false; else { if ((strIndex_620757018 == ((str_620757010) == null ? 0 : (str_620757010).length))) Temporary8 = true; else { Temporary8 = !((ConstSet9[str_620757010.charCodeAt(chckIndx(strIndex_620757018, 0, (str_620757010).length - 1))] != undefined)); } Temporary7 = Temporary8; } if (Temporary7) { + score_620757020 = addInt(score_620757020, 10); + } + + var colontmp__469762411 = nimMax(0, score_620757020); + var colontmp__469762412 = (0 < score_620757020); + result_620757013 = nimCopy(result_620757013, {Field0: colontmp__469762411, Field1: colontmp__469762412}, NTI620757006); + + return result_620757013; + +} + +function raiseDivByZero() { + raiseException({message: makeNimstrLit("division by zero"), parent: null, m_type: NTI33555121, name: null, trace: [], up: null}, "DivByZeroDefect"); + + +} + +function parseSaturatedNatural_654311758(s_654311759, b_654311760, b_654311760_Idx, start_654311761) { + var Temporary1; + var Temporary4; + + var result_654311762 = 0; + + var i_654311763 = start_654311761; + if (((i_654311763 < (s_654311759).length) && (s_654311759[chckIndx(i_654311763, 0, (s_654311759).length - 1)] == 43))) { + i_654311763 = addInt(i_654311763, 1); + } + + if (!(i_654311763 < (s_654311759).length)) Temporary1 = false; else { Temporary1 = (ConstSet14[s_654311759[chckIndx(i_654311763, 0, (s_654311759).length - 1)]] != undefined); } if (Temporary1) { + b_654311760[b_654311760_Idx] = 0; + Label2: do { + Label3: while (true) { + if (!(i_654311763 < (s_654311759).length)) Temporary4 = false; else { Temporary4 = (ConstSet15[s_654311759[chckIndx(i_654311763, 0, (s_654311759).length - 1)]] != undefined); } if (!Temporary4) break Label3; + var c_654311782 = subInt(s_654311759[chckIndx(i_654311763, 0, (s_654311759).length - 1)], 48); + if ((b_654311760[b_654311760_Idx] <= divInt(subInt(2147483647, c_654311782), 10))) { + b_654311760[b_654311760_Idx] = addInt(mulInt(b_654311760[b_654311760_Idx], 10), c_654311782); + } + else { + b_654311760[b_654311760_Idx] = 2147483647; + } + + i_654311763 = addInt(i_654311763, 1); + Label5: do { + Label6: while (true) { + if (!((i_654311763 < (s_654311759).length) && (s_654311759[chckIndx(i_654311763, 0, (s_654311759).length - 1)] == 95))) break Label6; + i_654311763 = addInt(i_654311763, 1); + } + } while (false); + } + } while (false); + result_654311762 = subInt(i_654311763, start_654311761); + } + + + return result_654311762; + +} + +function HEX5BHEX5D_939527322(s_939527325, x_939527326) { + var result_939527327 = []; + + var a_939527329 = x_939527326.a; + var L_939527331 = addInt(subInt(subInt((s_939527325).length, x_939527326.b), a_939527329), 1); + result_939527327 = nimCopy(null, mnewString(chckRange(L_939527331, 0, 2147483647)), NTI33554439); + Label1: do { + var i_939527336 = 0; + var i_469762416 = 0; + Label2: do { + Label3: while (true) { + if (!(i_469762416 < L_939527331)) break Label3; + i_939527336 = i_469762416; + result_939527327[chckIndx(i_939527336, 0, (result_939527327).length - 1)] = s_939527325[chckIndx(addInt(i_939527336, a_939527329), 0, (s_939527325).length - 1)]; + i_469762416 = addInt(i_469762416, 1); + } + } while (false); + } while (false); + + return result_939527327; + +} + +function HEX2EHEX2E_872415312(a_872415315, b_872415316) { + var result_872415319 = ({a: 0, b: 0}); + + result_872415319 = nimCopy(result_872415319, {a: a_872415315, b: b_872415316}, NTI872415311); + + return result_872415319; + +} + +function parseStandardFormatSpecifier_1358954554(s_1358954555, start_1358954556, ignoreUnknownSuffix_1358954557) { + var Temporary1; + var Temporary2; + var Temporary3; + + var result_1358954558 = ({fill: 0, align: 0, sign: 0, alternateForm: false, padWithZero: false, minimumWidth: 0, precision: 0, typ: 0, endPosition: 0}); + + result_1358954558.fill = 32; + result_1358954558.align = 0; + result_1358954558.sign = 45; + var i_1358954560 = start_1358954556; + if (((addInt(i_1358954560, 1) < (s_1358954555).length) && (ConstSet10[s_1358954555[chckIndx(addInt(i_1358954560, 1), 0, (s_1358954555).length - 1)]] != undefined))) { + result_1358954558.fill = s_1358954555[chckIndx(i_1358954560, 0, (s_1358954555).length - 1)]; + result_1358954558.align = s_1358954555[chckIndx(addInt(i_1358954560, 1), 0, (s_1358954555).length - 1)]; + i_1358954560 = addInt(i_1358954560, 2); + } + else { + if (((i_1358954560 < (s_1358954555).length) && (ConstSet11[s_1358954555[chckIndx(i_1358954560, 0, (s_1358954555).length - 1)]] != undefined))) { + result_1358954558.align = s_1358954555[chckIndx(i_1358954560, 0, (s_1358954555).length - 1)]; + i_1358954560 = addInt(i_1358954560, 1); + } + } + if (((i_1358954560 < (s_1358954555).length) && (ConstSet12[s_1358954555[chckIndx(i_1358954560, 0, (s_1358954555).length - 1)]] != undefined))) { + result_1358954558.sign = s_1358954555[chckIndx(i_1358954560, 0, (s_1358954555).length - 1)]; + i_1358954560 = addInt(i_1358954560, 1); + } + + if (((i_1358954560 < (s_1358954555).length) && (s_1358954555[chckIndx(i_1358954560, 0, (s_1358954555).length - 1)] == 35))) { + result_1358954558.alternateForm = true; + i_1358954560 = addInt(i_1358954560, 1); + } + + if (!((addInt(i_1358954560, 1) < (s_1358954555).length) && (s_1358954555[chckIndx(i_1358954560, 0, (s_1358954555).length - 1)] == 48))) Temporary1 = false; else { Temporary1 = (ConstSet13[s_1358954555[chckIndx(addInt(i_1358954560, 1), 0, (s_1358954555).length - 1)]] != undefined); } if (Temporary1) { + result_1358954558.padWithZero = true; + i_1358954560 = addInt(i_1358954560, 1); + } + + var parsedLength_1358954597 = parseSaturatedNatural_654311758(s_1358954555, result_1358954558, "minimumWidth", i_1358954560); + i_1358954560 = addInt(i_1358954560, parsedLength_1358954597); + if (((i_1358954560 < (s_1358954555).length) && (s_1358954555[chckIndx(i_1358954560, 0, (s_1358954555).length - 1)] == 46))) { + i_1358954560 = addInt(i_1358954560, 1); + var parsedLengthB_1358954606 = parseSaturatedNatural_654311758(s_1358954555, result_1358954558, "precision", i_1358954560); + i_1358954560 = addInt(i_1358954560, parsedLengthB_1358954606); + } + else { + result_1358954558.precision = -1; + } + + if (!(i_1358954560 < (s_1358954555).length)) Temporary2 = false; else { Temporary2 = (ConstSet16[s_1358954555[chckIndx(i_1358954560, 0, (s_1358954555).length - 1)]] != undefined); } if (Temporary2) { + result_1358954558.typ = s_1358954555[chckIndx(i_1358954560, 0, (s_1358954555).length - 1)]; + i_1358954560 = addInt(i_1358954560, 1); + } + + result_1358954558.endPosition = i_1358954560; + if (!!((i_1358954560 == (s_1358954555).length))) Temporary3 = false; else { Temporary3 = !(ignoreUnknownSuffix_1358954557); } if (Temporary3) { + raiseException({message: (makeNimstrLit("invalid format string, cannot parse: ") || []).concat(HEX5BHEX5D_939527322(s_1358954555, HEX2EHEX2E_872415312(i_1358954560, 1)) || []), parent: null, m_type: NTI33555125, name: null, trace: [], up: null}, "ValueError"); + } + + + return result_1358954558; + +} + +function nucruneLen(s_939524106) { + var result_939524107 = 0; + + result_939524107 = 0; + var i_939524108 = 0; + Label1: do { + Label2: while (true) { + if (!(i_939524108 < (s_939524106).length)) break Label2; + if ((s_939524106[chckIndx(i_939524108, 0, (s_939524106).length - 1)] <= 127)) { + i_939524108 = addInt(i_939524108, 1); + } + else { + if (((s_939524106[chckIndx(i_939524108, 0, (s_939524106).length - 1)] >>> 5) == 6)) { + i_939524108 = addInt(i_939524108, 2); + } + else { + if (((s_939524106[chckIndx(i_939524108, 0, (s_939524106).length - 1)] >>> 4) == 14)) { + i_939524108 = addInt(i_939524108, 3); + } + else { + if (((s_939524106[chckIndx(i_939524108, 0, (s_939524106).length - 1)] >>> 3) == 30)) { + i_939524108 = addInt(i_939524108, 4); + } + else { + if (((s_939524106[chckIndx(i_939524108, 0, (s_939524106).length - 1)] >>> 2) == 62)) { + i_939524108 = addInt(i_939524108, 5); + } + else { + if (((s_939524106[chckIndx(i_939524108, 0, (s_939524106).length - 1)] >>> 1) == 126)) { + i_939524108 = addInt(i_939524108, 6); + } + else { + i_939524108 = addInt(i_939524108, 1); + } + }}}}} + result_939524107 = addInt(result_939524107, 1); + } + } while (false); + + return result_939524107; + +} + +function runeLenAt_939524161(s_939524162, i_939524163) { + var result_939524164 = 0; + + if ((s_939524162[chckIndx(i_939524163, 0, (s_939524162).length - 1)] <= 127)) { + result_939524164 = 1; + } + else { + if (((s_939524162[chckIndx(i_939524163, 0, (s_939524162).length - 1)] >>> 5) == 6)) { + result_939524164 = 2; + } + else { + if (((s_939524162[chckIndx(i_939524163, 0, (s_939524162).length - 1)] >>> 4) == 14)) { + result_939524164 = 3; + } + else { + if (((s_939524162[chckIndx(i_939524163, 0, (s_939524162).length - 1)] >>> 3) == 30)) { + result_939524164 = 4; + } + else { + if (((s_939524162[chckIndx(i_939524163, 0, (s_939524162).length - 1)] >>> 2) == 62)) { + result_939524164 = 5; + } + else { + if (((s_939524162[chckIndx(i_939524163, 0, (s_939524162).length - 1)] >>> 1) == 126)) { + result_939524164 = 6; + } + else { + result_939524164 = 1; + } + }}}}} + + return result_939524164; + +} + +function runeOffset_939524733(s_939524734, pos_939524735, start_939524736) { + var result_939524737 = 0; + + BeforeRet: do { + var i_939524738 = 0; + var o_939524739 = start_939524736; + Label1: do { + Label2: while (true) { + if (!(i_939524738 < pos_939524735)) break Label2; + o_939524739 = addInt(o_939524739, chckRange(runeLenAt_939524161(s_939524734, o_939524739), 0, 2147483647)); + if (((s_939524734).length <= o_939524739)) { + result_939524737 = -1; + break BeforeRet; + } + + i_939524738 = addInt(i_939524738, 1); + } + } while (false); + result_939524737 = o_939524739; + break BeforeRet; + } while (false); + + return result_939524737; + +} + +function validateUtf8_939524373(s_939524374) { + var Temporary3; + var Temporary4; + var Temporary5; + var Temporary6; + var Temporary7; + var Temporary8; + + var result_939524375 = 0; + + BeforeRet: do { + var i_939524376 = 0; + var L_939524377 = (s_939524374).length; + Label1: do { + Label2: while (true) { + if (!(i_939524376 < L_939524377)) break Label2; + if ((s_939524374[chckIndx(i_939524376, 0, (s_939524374).length - 1)] <= 127)) { + i_939524376 = addInt(i_939524376, 1); + } + else { + if (((s_939524374[chckIndx(i_939524376, 0, (s_939524374).length - 1)] >>> 5) == 6)) { + if ((s_939524374[chckIndx(i_939524376, 0, (s_939524374).length - 1)] < 194)) { + result_939524375 = i_939524376; + break BeforeRet; + } + + if (!(addInt(i_939524376, 1) < L_939524377)) Temporary3 = false; else { Temporary3 = ((s_939524374[chckIndx(addInt(i_939524376, 1), 0, (s_939524374).length - 1)] >>> 6) == 2); } if (Temporary3) { + i_939524376 = addInt(i_939524376, 2); + } + else { + result_939524375 = i_939524376; + break BeforeRet; + } + + } + else { + if (((s_939524374[chckIndx(i_939524376, 0, (s_939524374).length - 1)] >>> 4) == 14)) { + if (!(addInt(i_939524376, 2) < L_939524377)) Temporary5 = false; else { Temporary5 = ((s_939524374[chckIndx(addInt(i_939524376, 1), 0, (s_939524374).length - 1)] >>> 6) == 2); } if (!Temporary5) Temporary4 = false; else { Temporary4 = ((s_939524374[chckIndx(addInt(i_939524376, 2), 0, (s_939524374).length - 1)] >>> 6) == 2); } if (Temporary4) { + i_939524376 = addInt(i_939524376, 3); + } + else { + result_939524375 = i_939524376; + break BeforeRet; + } + + } + else { + if (((s_939524374[chckIndx(i_939524376, 0, (s_939524374).length - 1)] >>> 3) == 30)) { + if (!(addInt(i_939524376, 3) < L_939524377)) Temporary8 = false; else { Temporary8 = ((s_939524374[chckIndx(addInt(i_939524376, 1), 0, (s_939524374).length - 1)] >>> 6) == 2); } if (!Temporary8) Temporary7 = false; else { Temporary7 = ((s_939524374[chckIndx(addInt(i_939524376, 2), 0, (s_939524374).length - 1)] >>> 6) == 2); } if (!Temporary7) Temporary6 = false; else { Temporary6 = ((s_939524374[chckIndx(addInt(i_939524376, 3), 0, (s_939524374).length - 1)] >>> 6) == 2); } if (Temporary6) { + i_939524376 = addInt(i_939524376, 4); + } + else { + result_939524375 = i_939524376; + break BeforeRet; + } + + } + else { + result_939524375 = i_939524376; + break BeforeRet; + } + }}} + } + } while (false); + result_939524375 = -1; + break BeforeRet; + } while (false); + + return result_939524375; + +} + +function nsuRepeatChar(c_637535227, count_637535228) { + var result_637535229 = []; + + result_637535229 = nimCopy(null, mnewString(count_637535228), NTI33554439); + Label1: do { + var i_637535234 = 0; + var colontmp__469762422 = 0; + colontmp__469762422 = subInt(count_637535228, 1); + var res_469762423 = 0; + Label2: do { + Label3: while (true) { + if (!(res_469762423 <= colontmp__469762422)) break Label3; + i_637535234 = res_469762423; + result_637535229[chckIndx(i_637535234, 0, (result_637535229).length - 1)] = c_637535227; + res_469762423 = addInt(res_469762423, 1); + } + } while (false); + } while (false); + + return result_637535229; + +} + +function alignString_1358954516(s_1358954517, minimumWidth_1358954518, align_1358954519, fill_1358954520) { + var Temporary1; + + var result_1358954521 = []; + + if ((minimumWidth_1358954518 == 0)) { + result_1358954521 = nimCopy(null, s_1358954517, NTI33554439); + } + else { + if ((validateUtf8_939524373(s_1358954517) == -1)) { + Temporary1 = nucruneLen(s_1358954517); + } + else { + Temporary1 = (s_1358954517).length; + } + + var sRuneLen_1358954522 = Temporary1; + var toFill_1358954523 = subInt(minimumWidth_1358954518, sRuneLen_1358954522); + if ((toFill_1358954523 <= 0)) { + result_1358954521 = nimCopy(null, s_1358954517, NTI33554439); + } + else { + if (((align_1358954519 == 60) || (align_1358954519 == 0))) { + result_1358954521 = nimCopy(null, (s_1358954517 || []).concat(nsuRepeatChar(fill_1358954520, chckRange(toFill_1358954523, 0, 2147483647)) || []), NTI33554439); + } + else { + if ((align_1358954519 == 94)) { + var half_1358954524 = divInt(toFill_1358954523, 2); + result_1358954521 = nimCopy(null, (nsuRepeatChar(fill_1358954520, chckRange(half_1358954524, 0, 2147483647)) || []).concat(s_1358954517 || [],nsuRepeatChar(fill_1358954520, chckRange(subInt(toFill_1358954523, half_1358954524), 0, 2147483647)) || []), NTI33554439); + } + else { + result_1358954521 = nimCopy(null, (nsuRepeatChar(fill_1358954520, chckRange(toFill_1358954523, 0, 2147483647)) || []).concat(s_1358954517 || []), NTI33554439); + } + }} + } + + + return result_1358954521; + +} + +function formatValue_1358954658(result_1358954659, result_1358954659_Idx, value_1358954660, specifier_1358954661) { + var spec_1358954662 = parseStandardFormatSpecifier_1358954554(specifier_1358954661, 0, false); + var value_1358954663 = nimCopy(null, value_1358954660, NTI33554439); + switch (spec_1358954662.typ) { + case 115: + case 0: + break; + default: + raiseException({message: (makeNimstrLit("invalid type in format string for string, expected \'s\', but got ") || []).concat([spec_1358954662.typ]), parent: null, m_type: NTI33555125, name: null, trace: [], up: null}, "ValueError"); + break; + } + if (!((spec_1358954662.precision == -1))) { + if ((spec_1358954662.precision < nucruneLen(value_1358954663))) { + (value_1358954663.length = chckRange(runeOffset_939524733(value_1358954663, chckRange(spec_1358954662.precision, 0, 2147483647), 0), 0, 2147483647)); + } + + } + + result_1358954659[result_1358954659_Idx].push.apply(result_1358954659[result_1358954659_Idx], alignString_1358954516(value_1358954663, spec_1358954662.minimumWidth, spec_1358954662.align, spec_1358954662.fill));; + + +} + +function sysFatal_218103842(message_218103845) { + raiseException({message: nimCopy(null, message_218103845, NTI33554439), m_type: NTI33555124, parent: null, name: null, trace: [], up: null}, "AssertionDefect"); + + +} + +function raiseAssert_218103840(msg_218103841) { + sysFatal_218103842(msg_218103841); + + +} + +function failedAssertImpl_218103864(msg_218103865) { + raiseAssert_218103840(msg_218103865); + + +} + +function mkDigit_1358954501(v_1358954502, typ_1358954503) { + var Temporary1; + + var result_1358954504 = []; + + if (!((v_1358954502 < 26))) { + failedAssertImpl_218103864(makeNimstrLit("strformat.nim(320, 9) `v < 26` ")); + } + + if ((v_1358954502 < 10)) { + result_1358954504 = nimCopy(null, nimCharToStr(chckRange(addInt(48, v_1358954502), 0, 255)), NTI33554439); + } + else { + if ((typ_1358954503 == 120)) { + Temporary1 = 97; + } + else { + Temporary1 = 65; + } + + result_1358954504 = nimCopy(null, nimCharToStr(chckRange(subInt(addInt(Temporary1, v_1358954502), 10), 0, 255)), NTI33554439); + } + + + return result_1358954504; + +} + +function formatInt_469762199(n_469762201, radix_469762202, spec_469762203) { + var Temporary1; + var Temporary8; + + var result_469762204 = []; + + var n_469762207 = n_469762201; + var negative_469762208 = (n_469762207 < 0); + if (negative_469762208) { + Temporary1 = ((~(n_469762207) + 1) ); + } + else { + Temporary1 = n_469762207; + } + + var v_469762209 = Temporary1; + var xx_469762210 = []; + if (spec_469762203.alternateForm) { + switch (spec_469762203.typ) { + case 88: + xx_469762210 = nimCopy(null, makeNimstrLit("0x"), NTI33554439); + break; + case 120: + xx_469762210 = nimCopy(null, makeNimstrLit("0x"), NTI33554439); + break; + case 98: + xx_469762210 = nimCopy(null, makeNimstrLit("0b"), NTI33554439); + break; + case 111: + xx_469762210 = nimCopy(null, makeNimstrLit("0o"), NTI33554439); + break; + default: + break; + } + } + + if ((v_469762209 == 0)) { + result_469762204 = nimCopy(null, makeNimstrLit("0"), NTI33554439); + } + else { + result_469762204 = nimCopy(null, [], NTI33554439); + Label2: do { + Label3: while (true) { + if (!(0 < v_469762209)) break Label3; + var d_469762211 = (v_469762209 % radix_469762202); + v_469762209 = Math.trunc(((v_469762209 / radix_469762202) )); + result_469762204.push.apply(result_469762204, mkDigit_1358954501(chckRange(d_469762211, -2147483648, 2147483647), spec_469762203.typ));; + } + } while (false); + Label4: do { + var idx_469762216 = 0; + var colontmp__469762427 = 0; + colontmp__469762427 = divInt((result_469762204).length, 2); + var i_469762428 = 0; + Label5: do { + Label6: while (true) { + if (!(i_469762428 < colontmp__469762427)) break Label6; + idx_469762216 = i_469762428; + var Temporary7 = result_469762204[chckIndx(idx_469762216, 0, (result_469762204).length - 1)]; result_469762204[chckIndx(idx_469762216, 0, (result_469762204).length - 1)] = result_469762204[chckIndx(subInt(subInt((result_469762204).length, idx_469762216), 1), 0, (result_469762204).length - 1)]; result_469762204[chckIndx(subInt(subInt((result_469762204).length, idx_469762216), 1), 0, (result_469762204).length - 1)] = Temporary7; i_469762428 = addInt(i_469762428, 1); + } + } while (false); + } while (false); + } + + if (spec_469762203.padWithZero) { + if (negative_469762208) Temporary8 = true; else { Temporary8 = !((spec_469762203.sign == 45)); } var sign_469762221 = Temporary8; + var toFill_469762225 = subInt(subInt(subInt(spec_469762203.minimumWidth, (result_469762204).length), (xx_469762210).length), (sign_469762221 ? 1 : 0)); + if ((0 < toFill_469762225)) { + result_469762204 = nimCopy(null, (nsuRepeatChar(48, chckRange(toFill_469762225, 0, 2147483647)) || []).concat(result_469762204 || []), NTI33554439); + } + + } + + if (negative_469762208) { + result_469762204 = nimCopy(null, (makeNimstrLit("-") || []).concat(xx_469762210 || [],result_469762204 || []), NTI33554439); + } + else { + if (!((spec_469762203.sign == 45))) { + result_469762204 = nimCopy(null, [spec_469762203.sign].concat(xx_469762210 || [],result_469762204 || []), NTI33554439); + } + else { + result_469762204 = nimCopy(null, (xx_469762210 || []).concat(result_469762204 || []), NTI33554439); + } + } + if ((spec_469762203.align == 60)) { + Label9: do { + var i_469762230 = 0; + var colontmp__469762431 = 0; + colontmp__469762431 = (result_469762204).length; + var i_469762432 = colontmp__469762431; + Label10: do { + Label11: while (true) { + if (!(i_469762432 < spec_469762203.minimumWidth)) break Label11; + i_469762230 = i_469762432; + addChar(result_469762204, spec_469762203.fill);; + i_469762432 = addInt(i_469762432, 1); + } + } while (false); + } while (false); + } + else { + var toFill_469762231 = subInt(spec_469762203.minimumWidth, (result_469762204).length); + if ((spec_469762203.align == 94)) { + var half_469762232 = divInt(toFill_469762231, 2); + result_469762204 = nimCopy(null, (nsuRepeatChar(spec_469762203.fill, chckRange(half_469762232, 0, 2147483647)) || []).concat(result_469762204 || [],nsuRepeatChar(spec_469762203.fill, chckRange(subInt(toFill_469762231, half_469762232), 0, 2147483647)) || []), NTI33554439); + } + else { + if ((0 < toFill_469762231)) { + result_469762204 = nimCopy(null, (nsuRepeatChar(spec_469762203.fill, chckRange(toFill_469762231, 0, 2147483647)) || []).concat(result_469762204 || []), NTI33554439); + } + + } + + } + + + return result_469762204; + +} + +function formatValue_469762191(result_469762193, result_469762193_Idx, value_469762194, specifier_469762195) { + BeforeRet: do { + if (((specifier_469762195).length == 0)) { + result_469762193[result_469762193_Idx].push.apply(result_469762193[result_469762193_Idx], HEX24_335544323(value_469762194));; + break BeforeRet; + } + + var spec_469762196 = parseStandardFormatSpecifier_1358954554(specifier_469762195, 0, false); + var radix_469762197 = 10; + switch (spec_469762196.typ) { + case 120: + case 88: + radix_469762197 = 16; + break; + case 100: + case 0: + break; + case 98: + radix_469762197 = 2; + break; + case 111: + radix_469762197 = 8; + break; + default: + raiseException({message: (makeNimstrLit("invalid type in format string for number, expected one of \'x\', \'X\', \'b\', \'d\', \'o\' but got: ") || []).concat([spec_469762196.typ]), parent: null, m_type: NTI33555125, name: null, trace: [], up: null}, "ValueError"); + break; + } + result_469762193[result_469762193_Idx].push.apply(result_469762193[result_469762193_Idx], formatInt_469762199(value_469762194, radix_469762197, spec_469762196));; + } while (false); + + +} + +function onInput(e_469762083) { + +function HEX3Aanonymous_469762245(a_469762250, b_469762251) { + var result_469762256 = 0; + + result_469762256 = subInt(b_469762251.score, a_469762250.score); + + return result_469762256; + + } + + BeforeRet: do { + var searchContainer_469762084 = document.getElementById("search-results"); + var matches_469762085 = []; + searchContainer_469762084.innerHTML = ""; + var input_469762086 = e_469762083.target.value; + if ((input_469762086 == "")) { + break BeforeRet; + } + + Label1: do { + var item_469762108 = ({title: [], slug: [], contentTokens: [], displayContent: []}); + var i_469762371 = 0; + var L_469762372 = (searchDB_469762065[0]).length; + Label2: do { + Label3: while (true) { + if (!(i_469762371 < L_469762372)) break Label3; + item_469762108 = searchDB_469762065[0][chckIndx(i_469762371, 0, (searchDB_469762065[0]).length - 1)]; + var title_469762109 = nsuReplaceStr(item_469762108.slug, makeNimstrLit(".html"), []); + Label4: do { + var token_469762130 = []; + var i_469762367 = 0; + var L_469762368 = (item_469762108.contentTokens).length; + Label5: do { + Label6: while (true) { + if (!(i_469762367 < L_469762368)) break Label6; + token_469762130 = item_469762108.contentTokens[chckIndx(i_469762367, 0, (item_469762108.contentTokens).length - 1)]; + var colontmp__469762408 = fuzzyMatch_620757008(input_469762086, toJSStr(token_469762130)); + var score_469762131 = colontmp__469762408["Field0"]; + var match_469762132 = colontmp__469762408["Field1"]; + if (match_469762132) { + var exists_469762133 = false; + Label7: do { + var i_469762175 = 0; + var m_469762176 = ({element: [], slug: [], count: 0, score: 0}); + var i_469762363 = 0; + var L_469762364 = (matches_469762085).length; + Label8: do { + Label9: while (true) { + if (!(i_469762363 < L_469762364)) break Label9; + i_469762175 = i_469762363; + m_469762176 = nimCopy(m_469762176, matches_469762085[chckIndx(i_469762363, 0, (matches_469762085).length - 1)], NTI469762051); + if (eqStrings(m_469762176.slug, item_469762108.slug)) { + exists_469762133 = true; + matches_469762085[chckIndx(i_469762175, 0, (matches_469762085).length - 1)].count = addInt(m_469762176.count, 1); + var fmtRes_469762185 = [mnewString(0)]; + fmtRes_469762185[0].push.apply(fmtRes_469762185[0], makeNimstrLit(""));; + formatValue_1358954658(fmtRes_469762185, 0, title_469762109, []); + fmtRes_469762185[0].push.apply(fmtRes_469762185[0], makeNimstrLit("("));; + formatValue_469762191(fmtRes_469762185, 0, matches_469762085[chckIndx(i_469762175, 0, (matches_469762085).length - 1)].count, []); + fmtRes_469762185[0].push.apply(fmtRes_469762185[0], makeNimstrLit(" matches)"));; + var webNode_469762233 = nimCopy(null, fmtRes_469762185[0], NTI33554439); + matches_469762085[chckIndx(i_469762175, 0, (matches_469762085).length - 1)].element = nimCopy(null, webNode_469762233, NTI33554439); + } + + i_469762363 = addInt(i_469762363, 1); + if (!(((matches_469762085).length == L_469762364))) { + failedAssertImpl_218103864(makeNimstrLit("iterators.nim(173, 11) `len(a) == L` the length of the seq changed while iterating over it")); + } + + } + } while (false); + } while (false); + if (!(exists_469762133)) { + var fmtRes_469762238 = [mnewString(0)]; + fmtRes_469762238[0].push.apply(fmtRes_469762238[0], makeNimstrLit(""));; + formatValue_1358954658(fmtRes_469762238, 0, title_469762109, []); + fmtRes_469762238[0].push.apply(fmtRes_469762238[0], makeNimstrLit("(1 match)"));; + var webNode_469762239 = nimCopy(null, fmtRes_469762238[0], NTI33554439); + var sResult_469762240 = ({element: [], slug: [], count: 0, score: 0}); + sResult_469762240.slug = nimCopy(null, item_469762108.slug, NTI33554439); + sResult_469762240.element = nimCopy(null, webNode_469762239, NTI33554439); + sResult_469762240.score = score_469762131; + sResult_469762240.count = 0; + var Temporary10 = nimCopy(null, sResult_469762240, NTI469762051); + matches_469762085.push(Temporary10);; + } + + } + + i_469762367 = addInt(i_469762367, 1); + if (!(((item_469762108.contentTokens).length == L_469762368))) { + failedAssertImpl_218103864(makeNimstrLit("iterators.nim(240, 11) `len(a) == L` the length of the seq changed while iterating over it")); + } + + } + } while (false); + } while (false); + i_469762371 = addInt(i_469762371, 1); + if (!(((searchDB_469762065[0]).length == L_469762372))) { + failedAssertImpl_218103864(makeNimstrLit("iterators.nim(240, 11) `len(a) == L` the length of the seq changed while iterating over it")); + } + + } + } while (false); + } while (false); + matches_469762085.sort(HEX3Aanonymous_469762245); + Label11: do { + var m_469762285 = ({element: [], slug: [], count: 0, score: 0}); + var i_469762376 = 0; + var L_469762377 = (matches_469762085).length; + Label12: do { + Label13: while (true) { + if (!(i_469762376 < L_469762377)) break Label13; + m_469762285 = matches_469762085[chckIndx(i_469762376, 0, (matches_469762085).length - 1)]; + var container_469762286 = document.createElement("div"); + container_469762286.classList.add("mudkip-search-item"); + container_469762286.innerHTML = toJSStr(m_469762285.element); + searchContainer_469762084.appendChild(container_469762286); + i_469762376 = addInt(i_469762376, 1); + if (!(((matches_469762085).length == L_469762377))) { + failedAssertImpl_218103864(makeNimstrLit("iterators.nim(240, 11) `len(a) == L` the length of the seq changed while iterating over it")); + } + + } + } while (false); + } while (false); + } while (false); + + +} + +function HEX3CHEX3DHEX25_33555429(x_33555430, y_33555431) { + var result_33555432 = false; + + result_33555432 = ((x_33555430 >>> 0) <= (y_33555431 >>> 0)); + + return result_33555432; + +} + +function nuctoUTF8(c_939524437) { + var result_939524438 = []; + + result_939524438 = nimCopy(null, [], NTI33554439); + var iHEX60gensym49_939524440 = c_939524437; + if (HEX3CHEX3DHEX25_33555429(iHEX60gensym49_939524440, 127)) { + (result_939524438.length = 1); + result_939524438[chckIndx(0, 0, (result_939524438).length - 1)] = chckRange(iHEX60gensym49_939524440, 0, 255); + } + else { + if (HEX3CHEX3DHEX25_33555429(iHEX60gensym49_939524440, 2047)) { + (result_939524438.length = 2); + result_939524438[chckIndx(0, 0, (result_939524438).length - 1)] = chckRange(((iHEX60gensym49_939524440 >> 6) | 192), 0, 255); + result_939524438[chckIndx(1, 0, (result_939524438).length - 1)] = chckRange(((iHEX60gensym49_939524440 & 63) | 128), 0, 255); + } + else { + if (HEX3CHEX3DHEX25_33555429(iHEX60gensym49_939524440, 65535)) { + (result_939524438.length = 3); + result_939524438[chckIndx(0, 0, (result_939524438).length - 1)] = chckRange(((iHEX60gensym49_939524440 >> 12) | 224), 0, 255); + result_939524438[chckIndx(1, 0, (result_939524438).length - 1)] = chckRange((((iHEX60gensym49_939524440 >> 6) & 63) | 128), 0, 255); + result_939524438[chckIndx(2, 0, (result_939524438).length - 1)] = chckRange(((iHEX60gensym49_939524440 & 63) | 128), 0, 255); + } + else { + if (HEX3CHEX3DHEX25_33555429(iHEX60gensym49_939524440, 2097151)) { + (result_939524438.length = 4); + result_939524438[chckIndx(0, 0, (result_939524438).length - 1)] = chckRange(((iHEX60gensym49_939524440 >> 18) | 240), 0, 255); + result_939524438[chckIndx(1, 0, (result_939524438).length - 1)] = chckRange((((iHEX60gensym49_939524440 >> 12) & 63) | 128), 0, 255); + result_939524438[chckIndx(2, 0, (result_939524438).length - 1)] = chckRange((((iHEX60gensym49_939524440 >> 6) & 63) | 128), 0, 255); + result_939524438[chckIndx(3, 0, (result_939524438).length - 1)] = chckRange(((iHEX60gensym49_939524440 & 63) | 128), 0, 255); + } + else { + if (HEX3CHEX3DHEX25_33555429(iHEX60gensym49_939524440, 67108863)) { + (result_939524438.length = 5); + result_939524438[chckIndx(0, 0, (result_939524438).length - 1)] = chckRange(((iHEX60gensym49_939524440 >> 24) | 248), 0, 255); + result_939524438[chckIndx(1, 0, (result_939524438).length - 1)] = chckRange((((iHEX60gensym49_939524440 >> 18) & 63) | 128), 0, 255); + result_939524438[chckIndx(2, 0, (result_939524438).length - 1)] = chckRange((((iHEX60gensym49_939524440 >> 12) & 63) | 128), 0, 255); + result_939524438[chckIndx(3, 0, (result_939524438).length - 1)] = chckRange((((iHEX60gensym49_939524440 >> 6) & 63) | 128), 0, 255); + result_939524438[chckIndx(4, 0, (result_939524438).length - 1)] = chckRange(((iHEX60gensym49_939524440 & 63) | 128), 0, 255); + } + else { + if (HEX3CHEX3DHEX25_33555429(iHEX60gensym49_939524440, 2147483647)) { + (result_939524438.length = 6); + result_939524438[chckIndx(0, 0, (result_939524438).length - 1)] = chckRange(((iHEX60gensym49_939524440 >> 30) | 252), 0, 255); + result_939524438[chckIndx(1, 0, (result_939524438).length - 1)] = chckRange((((iHEX60gensym49_939524440 >> 24) & 63) | 128), 0, 255); + result_939524438[chckIndx(2, 0, (result_939524438).length - 1)] = chckRange((((iHEX60gensym49_939524440 >> 18) & 63) | 128), 0, 255); + result_939524438[chckIndx(3, 0, (result_939524438).length - 1)] = chckRange((((iHEX60gensym49_939524440 >> 12) & 63) | 128), 0, 255); + result_939524438[chckIndx(4, 0, (result_939524438).length - 1)] = chckRange((((iHEX60gensym49_939524440 >> 6) & 63) | 128), 0, 255); + result_939524438[chckIndx(5, 0, (result_939524438).length - 1)] = chckRange(((iHEX60gensym49_939524440 & 63) | 128), 0, 255); + } + else { + } + }}}}} + + return result_939524438; + +} + +function parseHex_637535109(s_637535111, number_637535112, number_637535112_Idx, start_637535113, maxLen_637535114) { + var Temporary1; + + var result_637535115 = 0; + + var i_637535116 = start_637535113; + var output_637535117 = 0; + var foundDigit_637535118 = false; + if ((maxLen_637535114 == 0)) { + Temporary1 = (s_637535111).length; + } + else { + Temporary1 = addInt(i_637535116, maxLen_637535114); + } + + var last_637535119 = nimMin((s_637535111).length, Temporary1); + if ((((addInt(i_637535116, 1) < last_637535119) && (s_637535111[chckIndx(i_637535116, 0, (s_637535111).length - 1)] == 48)) && (ConstSet18[s_637535111[chckIndx(addInt(i_637535116, 1), 0, (s_637535111).length - 1)]] != undefined))) { + i_637535116 = addInt(i_637535116, 2); + } + else { + if (((i_637535116 < last_637535119) && (s_637535111[chckIndx(i_637535116, 0, (s_637535111).length - 1)] == 35))) { + i_637535116 = addInt(i_637535116, 1); + } + } + Label2: do { + Label3: while (true) { + if (!(i_637535116 < last_637535119)) break Label3; + switch (s_637535111[chckIndx(i_637535116, 0, (s_637535111).length - 1)]) { + case 95: + break; + case 48: + case 49: + case 50: + case 51: + case 52: + case 53: + case 54: + case 55: + case 56: + case 57: + output_637535117 = ((output_637535117 << 4) | subInt(s_637535111[chckIndx(i_637535116, 0, (s_637535111).length - 1)], 48)); + foundDigit_637535118 = true; + break; + case 97: + case 98: + case 99: + case 100: + case 101: + case 102: + output_637535117 = ((output_637535117 << 4) | addInt(subInt(s_637535111[chckIndx(i_637535116, 0, (s_637535111).length - 1)], 97), 10)); + foundDigit_637535118 = true; + break; + case 65: + case 66: + case 67: + case 68: + case 69: + case 70: + output_637535117 = ((output_637535117 << 4) | addInt(subInt(s_637535111[chckIndx(i_637535116, 0, (s_637535111).length - 1)], 65), 10)); + foundDigit_637535118 = true; + break; + default: + break Label2; + break; + } + i_637535116 = addInt(i_637535116, 1); + } + } while (false); + if (foundDigit_637535118) { + number_637535112[number_637535112_Idx] = output_637535117; + result_637535115 = subInt(i_637535116, start_637535113); + } + + + return result_637535115; + +} + +function nsuParseHexInt(s_637535107) { + var Temporary1; + + var result_637535108 = [0]; + + result_637535108[0] = 0; + var L_637535166 = parseHex_637535109(s_637535107, result_637535108, 0, 0, 0); + if (!((L_637535166 == (s_637535107).length))) Temporary1 = true; else { Temporary1 = (L_637535166 == 0); } if (Temporary1) { + raiseException({message: (makeNimstrLit("invalid hex integer: ") || []).concat(s_637535107 || []), parent: null, m_type: NTI33555125, name: null, trace: [], up: null}, "ValueError"); + } + + + return result_637535108[0]; + +} + +function HEX5BHEX5D_939524972(s_939524975, x_939524976) { + var result_939524977 = []; + + var a_939524979 = x_939524976.a; + var L_939524981 = addInt(subInt(x_939524976.b, a_939524979), 1); + result_939524977 = nimCopy(null, mnewString(chckRange(L_939524981, 0, 2147483647)), NTI33554439); + Label1: do { + var i_939524986 = 0; + var i_469762771 = 0; + Label2: do { + Label3: while (true) { + if (!(i_469762771 < L_939524981)) break Label3; + i_939524986 = i_469762771; + result_939524977[chckIndx(i_939524986, 0, (result_939524977).length - 1)] = s_939524975[chckIndx(addInt(i_939524986, a_939524979), 0, (s_939524975).length - 1)]; + i_469762771 = addInt(i_469762771, 1); + } + } while (false); + } while (false); + + return result_939524977; + +} + +function HEX2EHEX2E_939524947(a_939524950, b_939524951) { + var result_939524952 = ({a: 0, b: 0}); + + result_939524952 = nimCopy(result_939524952, {a: a_939524950, b: b_939524951}, NTI687865917); + + return result_939524952; + +} + +function parseUnicodeEscape_1006633146(s_1006633147, i_1006633148, i_1006633148_Idx) { + var result_1006633149 = 0; + + i_1006633148[i_1006633148_Idx] += 1; + result_1006633149 = nsuParseHexInt(HEX5BHEX5D_939524972(s_1006633147, HEX2EHEX2E_939524947(i_1006633148[i_1006633148_Idx], ((i_1006633148[i_1006633148_Idx] + 4) - 1)))); + i_1006633148[i_1006633148_Idx] += 3; + if (((result_1006633149 & 64512) == 55296)) { + i_1006633148[i_1006633148_Idx] += 1; + if (!((s_1006633147[i_1006633148[i_1006633148_Idx]] == 92))) { + raiseException({message: (makeNimstrLit("Found an Orphan Surrogate. At offset: ") || []).concat(HEX24_335544323(i_1006633148[i_1006633148_Idx]) || []), parent: null, m_type: NTI1006632963, name: null, trace: [], up: null}, "JsonError"); + } + + i_1006633148[i_1006633148_Idx] += 1; + if (!((s_1006633147[i_1006633148[i_1006633148_Idx]] == 117))) { + raiseException({message: (makeNimstrLit("Found an Orphan Surrogate. At offset: ") || []).concat(HEX24_335544323(i_1006633148[i_1006633148_Idx]) || []), parent: null, m_type: NTI1006632963, name: null, trace: [], up: null}, "JsonError"); + } + + i_1006633148[i_1006633148_Idx] += 1; + var nextRune_1006633218 = nsuParseHexInt(HEX5BHEX5D_939524972(s_1006633147, HEX2EHEX2E_939524947(i_1006633148[i_1006633148_Idx], ((i_1006633148[i_1006633148_Idx] + 4) - 1)))); + i_1006633148[i_1006633148_Idx] += 3; + if (((nextRune_1006633218 & 64512) == 56320)) { + result_1006633149 = (65536 + (((result_1006633149 - 55296) << 10) | (nextRune_1006633218 - 56320))); + } + + } + + + return result_1006633149; + +} + +function parseStringSlow_1006633227(s_1006633228, i_1006633229, i_1006633229_Idx, v_1006633230, v_1006633230_Idx) { + Label1: do { + Label2: while (true) { + if (!(i_1006633229[i_1006633229_Idx] < (s_1006633228).length)) break Label2; + var c_1006633231 = s_1006633228[i_1006633229[i_1006633229_Idx]]; + switch (c_1006633231) { + case 34: + break Label1; + break; + case 92: + i_1006633229[i_1006633229_Idx] += 1; + var c_1006633236 = s_1006633228[i_1006633229[i_1006633229_Idx]]; + switch (c_1006633236) { + case 34: + case 92: + case 47: + addChar(v_1006633230[v_1006633230_Idx], c_1006633236);; + break; + case 98: + addChar(v_1006633230[v_1006633230_Idx], 8);; + break; + case 102: + addChar(v_1006633230[v_1006633230_Idx], 12);; + break; + case 110: + addChar(v_1006633230[v_1006633230_Idx], 10);; + break; + case 114: + addChar(v_1006633230[v_1006633230_Idx], 13);; + break; + case 116: + addChar(v_1006633230[v_1006633230_Idx], 9);; + break; + case 117: + v_1006633230[v_1006633230_Idx].push.apply(v_1006633230[v_1006633230_Idx], nuctoUTF8(((parseUnicodeEscape_1006633146(s_1006633228, i_1006633229, i_1006633229_Idx)) | 0)));; + break; + default: + addChar(v_1006633230[v_1006633230_Idx], c_1006633236);; + break; + } + break; + default: + addChar(v_1006633230[v_1006633230_Idx], c_1006633231);; + break; + } + i_1006633229[i_1006633229_Idx] += 1; + } + } while (false); + Label3: do { + Label4: while (true) { + if (!(i_1006633229[i_1006633229_Idx] < (s_1006633228).length)) break Label4; + var cHEX60gensym21_1006633242 = s_1006633228[i_1006633229[i_1006633229_Idx]]; + if (!((whiteSpace_1006632971[cHEX60gensym21_1006633242] != undefined))) { + break Label3; + } + + i_1006633229[i_1006633229_Idx] += 1; + } + } while (false); + if (((s_1006633228).length <= i_1006633229[i_1006633229_Idx])) { + raiseException({message: (makeNimstrLit("Expected \" but end reached. At offset: ") || []).concat(HEX24_335544323(i_1006633229[i_1006633229_Idx]) || []), parent: null, m_type: NTI1006632963, name: null, trace: [], up: null}, "JsonError"); + } + + if ((s_1006633228[i_1006633229[i_1006633229_Idx]] == 34)) { + i_1006633229[i_1006633229_Idx] += 1; + } + else { + raiseException({message: (makeNimstrLit("Expected \" but got ") || []).concat([s_1006633228[i_1006633229[i_1006633229_Idx]]],makeNimstrLit(" instead. At offset: ") || [],HEX24_335544323(i_1006633229[i_1006633229_Idx]) || []), parent: null, m_type: NTI1006632963, name: null, trace: [], up: null}, "JsonError"); + } + + + +} + +function parseHook_1006633362(s_1006633363, i_1006633364, i_1006633364_Idx, v_1006633365, v_1006633365_Idx) { + var Temporary3; + var Temporary4; + var Temporary5; + var Temporary6; + + BeforeRet: do { + Label1: do { + Label2: while (true) { + if (!(i_1006633364[i_1006633364_Idx] < (s_1006633363).length)) break Label2; + var cHEX60gensym52_1006633367 = s_1006633363[i_1006633364[i_1006633364_Idx]]; + if (!((whiteSpace_1006632971[cHEX60gensym52_1006633367] != undefined))) { + break Label1; + } + + i_1006633364[i_1006633364_Idx] += 1; + } + } while (false); + if (!((i_1006633364[i_1006633364_Idx] + 3) < (s_1006633363).length)) Temporary6 = false; else { Temporary6 = (s_1006633363[(i_1006633364[i_1006633364_Idx] + 0)] == 110); } if (!Temporary6) Temporary5 = false; else { Temporary5 = (s_1006633363[(i_1006633364[i_1006633364_Idx] + 1)] == 117); } if (!Temporary5) Temporary4 = false; else { Temporary4 = (s_1006633363[(i_1006633364[i_1006633364_Idx] + 2)] == 108); } if (!Temporary4) Temporary3 = false; else { Temporary3 = (s_1006633363[(i_1006633364[i_1006633364_Idx] + 3)] == 108); } if (Temporary3) { + i_1006633364[i_1006633364_Idx] += 4; + break BeforeRet; + } + + Label7: do { + Label8: while (true) { + if (!(i_1006633364[i_1006633364_Idx] < (s_1006633363).length)) break Label8; + var cHEX60gensym56_1006633381 = s_1006633363[i_1006633364[i_1006633364_Idx]]; + if (!((whiteSpace_1006632971[cHEX60gensym56_1006633381] != undefined))) { + break Label7; + } + + i_1006633364[i_1006633364_Idx] += 1; + } + } while (false); + if (((s_1006633363).length <= i_1006633364[i_1006633364_Idx])) { + raiseException({message: (makeNimstrLit("Expected \" but end reached. At offset: ") || []).concat(HEX24_335544323(i_1006633364[i_1006633364_Idx]) || []), parent: null, m_type: NTI1006632963, name: null, trace: [], up: null}, "JsonError"); + } + + if ((s_1006633363[i_1006633364[i_1006633364_Idx]] == 34)) { + i_1006633364[i_1006633364_Idx] += 1; + } + else { + raiseException({message: (makeNimstrLit("Expected \" but got ") || []).concat([s_1006633363[i_1006633364[i_1006633364_Idx]]],makeNimstrLit(" instead. At offset: ") || [],HEX24_335544323(i_1006633364[i_1006633364_Idx]) || []), parent: null, m_type: NTI1006632963, name: null, trace: [], up: null}, "JsonError"); + } + + parseStringSlow_1006633227(s_1006633363, i_1006633364, i_1006633364_Idx, v_1006633365, v_1006633365_Idx); + } while (false); + + +} + +function parseHook_469762581(s_469762583, i_469762584, i_469762584_Idx, v_469762585, v_469762585_Idx) { + var Temporary7; + var Temporary11; + + Label1: do { + Label2: while (true) { + if (!(i_469762584[i_469762584_Idx] < (s_469762583).length)) break Label2; + var cHEX60gensym65_469762587 = s_469762583[i_469762584[i_469762584_Idx]]; + if (!((whiteSpace_1006632971[cHEX60gensym65_469762587] != undefined))) { + break Label1; + } + + i_469762584[i_469762584_Idx] += 1; + } + } while (false); + if (((s_469762583).length <= i_469762584[i_469762584_Idx])) { + raiseException({message: (makeNimstrLit("Expected [ but end reached. At offset: ") || []).concat(HEX24_335544323(i_469762584[i_469762584_Idx]) || []), parent: null, m_type: NTI1006632963, name: null, trace: [], up: null}, "JsonError"); + } + + if ((s_469762583[i_469762584[i_469762584_Idx]] == 91)) { + i_469762584[i_469762584_Idx] += 1; + } + else { + raiseException({message: (makeNimstrLit("Expected [ but got ") || []).concat([s_469762583[i_469762584[i_469762584_Idx]]],makeNimstrLit(" instead. At offset: ") || [],HEX24_335544323(i_469762584[i_469762584_Idx]) || []), parent: null, m_type: NTI1006632963, name: null, trace: [], up: null}, "JsonError"); + } + + Label3: do { + Label4: while (true) { + if (!(i_469762584[i_469762584_Idx] < (s_469762583).length)) break Label4; + Label5: do { + Label6: while (true) { + if (!(i_469762584[i_469762584_Idx] < (s_469762583).length)) break Label6; + var cHEX60gensym75_469762603 = s_469762583[i_469762584[i_469762584_Idx]]; + if (!((whiteSpace_1006632971[cHEX60gensym75_469762603] != undefined))) { + break Label5; + } + + i_469762584[i_469762584_Idx] += 1; + } + } while (false); + if (!(i_469762584[i_469762584_Idx] < (s_469762583).length)) Temporary7 = false; else { Temporary7 = (s_469762583[i_469762584[i_469762584_Idx]] == 93); } if (Temporary7) { + break Label3; + } + + var element_469762612 = [[]]; + parseHook_1006633362(s_469762583, i_469762584, i_469762584_Idx, element_469762612, 0); + var Temporary8 = nimCopy(null, element_469762612[0], NTI33554439); + v_469762585[v_469762585_Idx].push(Temporary8);; + Label9: do { + Label10: while (true) { + if (!(i_469762584[i_469762584_Idx] < (s_469762583).length)) break Label10; + var cHEX60gensym79_469762618 = s_469762583[i_469762584[i_469762584_Idx]]; + if (!((whiteSpace_1006632971[cHEX60gensym79_469762618] != undefined))) { + break Label9; + } + + i_469762584[i_469762584_Idx] += 1; + } + } while (false); + if (!(i_469762584[i_469762584_Idx] < (s_469762583).length)) Temporary11 = false; else { Temporary11 = (s_469762583[i_469762584[i_469762584_Idx]] == 44); } if (Temporary11) { + i_469762584[i_469762584_Idx] += 1; + } + else { + break Label3; + } + + } + } while (false); + Label12: do { + Label13: while (true) { + if (!(i_469762584[i_469762584_Idx] < (s_469762583).length)) break Label13; + var cHEX60gensym84_469762632 = s_469762583[i_469762584[i_469762584_Idx]]; + if (!((whiteSpace_1006632971[cHEX60gensym84_469762632] != undefined))) { + break Label12; + } + + i_469762584[i_469762584_Idx] += 1; + } + } while (false); + if (((s_469762583).length <= i_469762584[i_469762584_Idx])) { + raiseException({message: (makeNimstrLit("Expected ] but end reached. At offset: ") || []).concat(HEX24_335544323(i_469762584[i_469762584_Idx]) || []), parent: null, m_type: NTI1006632963, name: null, trace: [], up: null}, "JsonError"); + } + + if ((s_469762583[i_469762584[i_469762584_Idx]] == 93)) { + i_469762584[i_469762584_Idx] += 1; + } + else { + raiseException({message: (makeNimstrLit("Expected ] but got ") || []).concat([s_469762583[i_469762584[i_469762584_Idx]]],makeNimstrLit(" instead. At offset: ") || [],HEX24_335544323(i_469762584[i_469762584_Idx]) || []), parent: null, m_type: NTI1006632963, name: null, trace: [], up: null}, "JsonError"); + } + + + +} + +function parseSymbol_1006633041(s_1006633042, i_1006633043, i_1006633043_Idx) { + var result_1006633044 = []; + + BeforeRet: do { + Label1: do { + Label2: while (true) { + if (!(i_1006633043[i_1006633043_Idx] < (s_1006633042).length)) break Label2; + var cHEX60gensym0_1006633046 = s_1006633042[i_1006633043[i_1006633043_Idx]]; + if (!((whiteSpace_1006632971[cHEX60gensym0_1006633046] != undefined))) { + break Label1; + } + + i_1006633043[i_1006633043_Idx] += 1; + } + } while (false); + var j_1006633055 = i_1006633043[i_1006633043_Idx]; + Label3: do { + Label4: while (true) { + if (!(i_1006633043[i_1006633043_Idx] < (s_1006633042).length)) break Label4; + switch (s_1006633042[i_1006633043[i_1006633043_Idx]]) { + case 44: + case 125: + case 93: + case 9: + case 10: + case 13: + case 32: + break Label3; + break; + default: + break; + } + i_1006633043[i_1006633043_Idx] += 1; + } + } while (false); + result_1006633044 = nimCopy(null, HEX5BHEX5D_939524972(s_1006633042, HEX2EHEX2E_939524947(j_1006633055, (i_1006633043[i_1006633043_Idx] - 1))), NTI33554439); + break BeforeRet; + } while (false); + + return result_1006633044; + +} + +function skipValue_1006633419(s_1006633420, i_1006633421, i_1006633421_Idx) { + var Temporary3; + var Temporary10; + var Temporary15; + var Temporary18; + var Temporary25; + var Temporary28; + var Temporary31; + + Label1: do { + Label2: while (true) { + if (!(i_1006633421[i_1006633421_Idx] < (s_1006633420).length)) break Label2; + var cHEX60gensym69_1006633423 = s_1006633420[i_1006633421[i_1006633421_Idx]]; + if (!((whiteSpace_1006632971[cHEX60gensym69_1006633423] != undefined))) { + break Label1; + } + + i_1006633421[i_1006633421_Idx] += 1; + } + } while (false); + if (!(i_1006633421[i_1006633421_Idx] < (s_1006633420).length)) Temporary3 = false; else { Temporary3 = (s_1006633420[i_1006633421[i_1006633421_Idx]] == 123); } if (Temporary3) { + Label4: do { + Label5: while (true) { + if (!(i_1006633421[i_1006633421_Idx] < (s_1006633420).length)) break Label5; + var cHEX60gensym73_1006633433 = s_1006633420[i_1006633421[i_1006633421_Idx]]; + if (!((whiteSpace_1006632971[cHEX60gensym73_1006633433] != undefined))) { + break Label4; + } + + i_1006633421[i_1006633421_Idx] += 1; + } + } while (false); + if (((s_1006633420).length <= i_1006633421[i_1006633421_Idx])) { + raiseException({message: (makeNimstrLit("Expected { but end reached. At offset: ") || []).concat(HEX24_335544323(i_1006633421[i_1006633421_Idx]) || []), parent: null, m_type: NTI1006632963, name: null, trace: [], up: null}, "JsonError"); + } + + if ((s_1006633420[i_1006633421[i_1006633421_Idx]] == 123)) { + i_1006633421[i_1006633421_Idx] += 1; + } + else { + raiseException({message: (makeNimstrLit("Expected { but got ") || []).concat([s_1006633420[i_1006633421[i_1006633421_Idx]]],makeNimstrLit(" instead. At offset: ") || [],HEX24_335544323(i_1006633421[i_1006633421_Idx]) || []), parent: null, m_type: NTI1006632963, name: null, trace: [], up: null}, "JsonError"); + } + + Label6: do { + Label7: while (true) { + if (!(i_1006633421[i_1006633421_Idx] < (s_1006633420).length)) break Label7; + Label8: do { + Label9: while (true) { + if (!(i_1006633421[i_1006633421_Idx] < (s_1006633420).length)) break Label9; + var cHEX60gensym83_1006633449 = s_1006633420[i_1006633421[i_1006633421_Idx]]; + if (!((whiteSpace_1006632971[cHEX60gensym83_1006633449] != undefined))) { + break Label8; + } + + i_1006633421[i_1006633421_Idx] += 1; + } + } while (false); + if (!(i_1006633421[i_1006633421_Idx] < (s_1006633420).length)) Temporary10 = false; else { Temporary10 = (s_1006633420[i_1006633421[i_1006633421_Idx]] == 125); } if (Temporary10) { + break Label6; + } + + skipValue_1006633419(s_1006633420, i_1006633421, i_1006633421_Idx); + Label11: do { + Label12: while (true) { + if (!(i_1006633421[i_1006633421_Idx] < (s_1006633420).length)) break Label12; + var cHEX60gensym87_1006633459 = s_1006633420[i_1006633421[i_1006633421_Idx]]; + if (!((whiteSpace_1006632971[cHEX60gensym87_1006633459] != undefined))) { + break Label11; + } + + i_1006633421[i_1006633421_Idx] += 1; + } + } while (false); + if (((s_1006633420).length <= i_1006633421[i_1006633421_Idx])) { + raiseException({message: (makeNimstrLit("Expected : but end reached. At offset: ") || []).concat(HEX24_335544323(i_1006633421[i_1006633421_Idx]) || []), parent: null, m_type: NTI1006632963, name: null, trace: [], up: null}, "JsonError"); + } + + if ((s_1006633420[i_1006633421[i_1006633421_Idx]] == 58)) { + i_1006633421[i_1006633421_Idx] += 1; + } + else { + raiseException({message: (makeNimstrLit("Expected : but got ") || []).concat([s_1006633420[i_1006633421[i_1006633421_Idx]]],makeNimstrLit(" instead. At offset: ") || [],HEX24_335544323(i_1006633421[i_1006633421_Idx]) || []), parent: null, m_type: NTI1006632963, name: null, trace: [], up: null}, "JsonError"); + } + + skipValue_1006633419(s_1006633420, i_1006633421, i_1006633421_Idx); + Label13: do { + Label14: while (true) { + if (!(i_1006633421[i_1006633421_Idx] < (s_1006633420).length)) break Label14; + var cHEX60gensym97_1006633475 = s_1006633420[i_1006633421[i_1006633421_Idx]]; + if (!((whiteSpace_1006632971[cHEX60gensym97_1006633475] != undefined))) { + break Label13; + } + + i_1006633421[i_1006633421_Idx] += 1; + } + } while (false); + if (!(i_1006633421[i_1006633421_Idx] < (s_1006633420).length)) Temporary15 = false; else { Temporary15 = (s_1006633420[i_1006633421[i_1006633421_Idx]] == 44); } if (Temporary15) { + i_1006633421[i_1006633421_Idx] += 1; + } + + } + } while (false); + Label16: do { + Label17: while (true) { + if (!(i_1006633421[i_1006633421_Idx] < (s_1006633420).length)) break Label17; + var cHEX60gensym101_1006633489 = s_1006633420[i_1006633421[i_1006633421_Idx]]; + if (!((whiteSpace_1006632971[cHEX60gensym101_1006633489] != undefined))) { + break Label16; + } + + i_1006633421[i_1006633421_Idx] += 1; + } + } while (false); + if (((s_1006633420).length <= i_1006633421[i_1006633421_Idx])) { + raiseException({message: (makeNimstrLit("Expected } but end reached. At offset: ") || []).concat(HEX24_335544323(i_1006633421[i_1006633421_Idx]) || []), parent: null, m_type: NTI1006632963, name: null, trace: [], up: null}, "JsonError"); + } + + if ((s_1006633420[i_1006633421[i_1006633421_Idx]] == 125)) { + i_1006633421[i_1006633421_Idx] += 1; + } + else { + raiseException({message: (makeNimstrLit("Expected } but got ") || []).concat([s_1006633420[i_1006633421[i_1006633421_Idx]]],makeNimstrLit(" instead. At offset: ") || [],HEX24_335544323(i_1006633421[i_1006633421_Idx]) || []), parent: null, m_type: NTI1006632963, name: null, trace: [], up: null}, "JsonError"); + } + + } + else { + if (!(i_1006633421[i_1006633421_Idx] < (s_1006633420).length)) Temporary18 = false; else { Temporary18 = (s_1006633420[i_1006633421[i_1006633421_Idx]] == 91); } if (Temporary18) { + Label19: do { + Label20: while (true) { + if (!(i_1006633421[i_1006633421_Idx] < (s_1006633420).length)) break Label20; + var cHEX60gensym112_1006633505 = s_1006633420[i_1006633421[i_1006633421_Idx]]; + if (!((whiteSpace_1006632971[cHEX60gensym112_1006633505] != undefined))) { + break Label19; + } + + i_1006633421[i_1006633421_Idx] += 1; + } + } while (false); + if (((s_1006633420).length <= i_1006633421[i_1006633421_Idx])) { + raiseException({message: (makeNimstrLit("Expected [ but end reached. At offset: ") || []).concat(HEX24_335544323(i_1006633421[i_1006633421_Idx]) || []), parent: null, m_type: NTI1006632963, name: null, trace: [], up: null}, "JsonError"); + } + + if ((s_1006633420[i_1006633421[i_1006633421_Idx]] == 91)) { + i_1006633421[i_1006633421_Idx] += 1; + } + else { + raiseException({message: (makeNimstrLit("Expected [ but got ") || []).concat([s_1006633420[i_1006633421[i_1006633421_Idx]]],makeNimstrLit(" instead. At offset: ") || [],HEX24_335544323(i_1006633421[i_1006633421_Idx]) || []), parent: null, m_type: NTI1006632963, name: null, trace: [], up: null}, "JsonError"); + } + + Label21: do { + Label22: while (true) { + if (!(i_1006633421[i_1006633421_Idx] < (s_1006633420).length)) break Label22; + Label23: do { + Label24: while (true) { + if (!(i_1006633421[i_1006633421_Idx] < (s_1006633420).length)) break Label24; + var cHEX60gensym122_1006633521 = s_1006633420[i_1006633421[i_1006633421_Idx]]; + if (!((whiteSpace_1006632971[cHEX60gensym122_1006633521] != undefined))) { + break Label23; + } + + i_1006633421[i_1006633421_Idx] += 1; + } + } while (false); + if (!(i_1006633421[i_1006633421_Idx] < (s_1006633420).length)) Temporary25 = false; else { Temporary25 = (s_1006633420[i_1006633421[i_1006633421_Idx]] == 93); } if (Temporary25) { + break Label21; + } + + skipValue_1006633419(s_1006633420, i_1006633421, i_1006633421_Idx); + Label26: do { + Label27: while (true) { + if (!(i_1006633421[i_1006633421_Idx] < (s_1006633420).length)) break Label27; + var cHEX60gensym125_1006633531 = s_1006633420[i_1006633421[i_1006633421_Idx]]; + if (!((whiteSpace_1006632971[cHEX60gensym125_1006633531] != undefined))) { + break Label26; + } + + i_1006633421[i_1006633421_Idx] += 1; + } + } while (false); + if (!(i_1006633421[i_1006633421_Idx] < (s_1006633420).length)) Temporary28 = false; else { Temporary28 = (s_1006633420[i_1006633421[i_1006633421_Idx]] == 44); } if (Temporary28) { + i_1006633421[i_1006633421_Idx] += 1; + } + + } + } while (false); + Label29: do { + Label30: while (true) { + if (!(i_1006633421[i_1006633421_Idx] < (s_1006633420).length)) break Label30; + var cHEX60gensym129_1006633545 = s_1006633420[i_1006633421[i_1006633421_Idx]]; + if (!((whiteSpace_1006632971[cHEX60gensym129_1006633545] != undefined))) { + break Label29; + } + + i_1006633421[i_1006633421_Idx] += 1; + } + } while (false); + if (((s_1006633420).length <= i_1006633421[i_1006633421_Idx])) { + raiseException({message: (makeNimstrLit("Expected ] but end reached. At offset: ") || []).concat(HEX24_335544323(i_1006633421[i_1006633421_Idx]) || []), parent: null, m_type: NTI1006632963, name: null, trace: [], up: null}, "JsonError"); + } + + if ((s_1006633420[i_1006633421[i_1006633421_Idx]] == 93)) { + i_1006633421[i_1006633421_Idx] += 1; + } + else { + raiseException({message: (makeNimstrLit("Expected ] but got ") || []).concat([s_1006633420[i_1006633421[i_1006633421_Idx]]],makeNimstrLit(" instead. At offset: ") || [],HEX24_335544323(i_1006633421[i_1006633421_Idx]) || []), parent: null, m_type: NTI1006632963, name: null, trace: [], up: null}, "JsonError"); + } + + } + else { + if (!(i_1006633421[i_1006633421_Idx] < (s_1006633420).length)) Temporary31 = false; else { Temporary31 = (s_1006633420[i_1006633421[i_1006633421_Idx]] == 34); } if (Temporary31) { + var str_1006633560 = [[]]; + parseHook_1006633362(s_1006633420, i_1006633421, i_1006633421_Idx, str_1006633560, 0); + } + else { + var _ = parseSymbol_1006633041(s_1006633420, i_1006633421, i_1006633421_Idx); + } + }} + + +} + +function parseObjectInner_469762529(s_469762531, i_469762532, i_469762532_Idx, v_469762533) { + var Temporary5; + var Temporary11; + var Temporary12; + var Temporary13; + var Temporary14; + var Temporary17; + + Label1: do { + Label2: while (true) { + if (!(i_469762532[i_469762532_Idx] < (s_469762531).length)) break Label2; + Label3: do { + Label4: while (true) { + if (!(i_469762532[i_469762532_Idx] < (s_469762531).length)) break Label4; + var cHEX60gensym46_469762535 = s_469762531[i_469762532[i_469762532_Idx]]; + if (!((whiteSpace_1006632971[cHEX60gensym46_469762535] != undefined))) { + break Label3; + } + + i_469762532[i_469762532_Idx] += 1; + } + } while (false); + if (!(i_469762532[i_469762532_Idx] < (s_469762531).length)) Temporary5 = false; else { Temporary5 = (s_469762531[i_469762532[i_469762532_Idx]] == 125); } if (Temporary5) { + break Label1; + } + + var key_469762544 = [[]]; + parseHook_1006633362(s_469762531, i_469762532, i_469762532_Idx, key_469762544, 0); + Label6: do { + Label7: while (true) { + if (!(i_469762532[i_469762532_Idx] < (s_469762531).length)) break Label7; + var cHEX60gensym51_469762546 = s_469762531[i_469762532[i_469762532_Idx]]; + if (!((whiteSpace_1006632971[cHEX60gensym51_469762546] != undefined))) { + break Label6; + } + + i_469762532[i_469762532_Idx] += 1; + } + } while (false); + if (((s_469762531).length <= i_469762532[i_469762532_Idx])) { + raiseException({message: (makeNimstrLit("Expected : but end reached. At offset: ") || []).concat(HEX24_335544323(i_469762532[i_469762532_Idx]) || []), parent: null, m_type: NTI1006632963, name: null, trace: [], up: null}, "JsonError"); + } + + if ((s_469762531[i_469762532[i_469762532_Idx]] == 58)) { + i_469762532[i_469762532_Idx] += 1; + } + else { + raiseException({message: (makeNimstrLit("Expected : but got ") || []).concat([s_469762531[i_469762532[i_469762532_Idx]]],makeNimstrLit(" instead. At offset: ") || [],HEX24_335544323(i_469762532[i_469762532_Idx]) || []), parent: null, m_type: NTI1006632963, name: null, trace: [], up: null}, "JsonError"); + } + + Label8: do { + Label9: do { + Label10: while (true) { + if (!true) break Label10; + if (eqStrings(makeNimstrLit("title"), key_469762544[0])) Temporary11 = true; else { Temporary11 = eqStrings(makeNimstrLit("title"), key_469762544[0]); } if (Temporary11) { + var v2_469762574 = [[]]; + parseHook_1006633362(s_469762531, i_469762532, i_469762532_Idx, v2_469762574, 0); + v_469762533.title = nimCopy(null, v2_469762574[0], NTI33554439); + break Label8; + } + + if (eqStrings(makeNimstrLit("slug"), key_469762544[0])) Temporary12 = true; else { Temporary12 = eqStrings(makeNimstrLit("slug"), key_469762544[0]); } if (Temporary12) { + var v2_469762577 = [[]]; + parseHook_1006633362(s_469762531, i_469762532, i_469762532_Idx, v2_469762577, 0); + v_469762533.slug = nimCopy(null, v2_469762577[0], NTI33554439); + break Label8; + } + + if (eqStrings(makeNimstrLit("contentTokens"), key_469762544[0])) Temporary13 = true; else { Temporary13 = eqStrings(makeNimstrLit("content_tokens"), key_469762544[0]); } if (Temporary13) { + var v2_469762580 = [[]]; + parseHook_469762581(s_469762531, i_469762532, i_469762532_Idx, v2_469762580, 0); + v_469762533.contentTokens = nimCopy(null, v2_469762580[0], NTI469762053); + break Label8; + } + + if (eqStrings(makeNimstrLit("displayContent"), key_469762544[0])) Temporary14 = true; else { Temporary14 = eqStrings(makeNimstrLit("display_content"), key_469762544[0]); } if (Temporary14) { + var v2_469762649 = [[]]; + parseHook_1006633362(s_469762531, i_469762532, i_469762532_Idx, v2_469762649, 0); + v_469762533.displayContent = nimCopy(null, v2_469762649[0], NTI33554439); + break Label8; + } + + break Label9; + } + } while (false); + skipValue_1006633419(s_469762531, i_469762532, i_469762532_Idx); + } while (false); + Label15: do { + Label16: while (true) { + if (!(i_469762532[i_469762532_Idx] < (s_469762531).length)) break Label16; + var cHEX60gensym95_469762651 = s_469762531[i_469762532[i_469762532_Idx]]; + if (!((whiteSpace_1006632971[cHEX60gensym95_469762651] != undefined))) { + break Label15; + } + + i_469762532[i_469762532_Idx] += 1; + } + } while (false); + if (!(i_469762532[i_469762532_Idx] < (s_469762531).length)) Temporary17 = false; else { Temporary17 = (s_469762531[i_469762532[i_469762532_Idx]] == 44); } if (Temporary17) { + i_469762532[i_469762532_Idx] += 1; + } + else { + break Label1; + } + + } + } while (false); + + +} + +function parseHook_469762480(s_469762482, i_469762483, i_469762483_Idx, v_469762484) { + var Temporary3; + var Temporary4; + var Temporary5; + var Temporary6; + + BeforeRet: do { + Label1: do { + Label2: while (true) { + if (!(i_469762483[i_469762483_Idx] < (s_469762482).length)) break Label2; + var cHEX60gensym28_469762486 = s_469762482[i_469762483[i_469762483_Idx]]; + if (!((whiteSpace_1006632971[cHEX60gensym28_469762486] != undefined))) { + break Label1; + } + + i_469762483[i_469762483_Idx] += 1; + } + } while (false); + if (!((i_469762483[i_469762483_Idx] + 3) < (s_469762482).length)) Temporary6 = false; else { Temporary6 = (s_469762482[(i_469762483[i_469762483_Idx] + 0)] == 110); } if (!Temporary6) Temporary5 = false; else { Temporary5 = (s_469762482[(i_469762483[i_469762483_Idx] + 1)] == 117); } if (!Temporary5) Temporary4 = false; else { Temporary4 = (s_469762482[(i_469762483[i_469762483_Idx] + 2)] == 108); } if (!Temporary4) Temporary3 = false; else { Temporary3 = (s_469762482[(i_469762483[i_469762483_Idx] + 3)] == 108); } if (Temporary3) { + i_469762483[i_469762483_Idx] += 4; + break BeforeRet; + } + + Label7: do { + Label8: while (true) { + if (!(i_469762483[i_469762483_Idx] < (s_469762482).length)) break Label8; + var cHEX60gensym36_469762500 = s_469762482[i_469762483[i_469762483_Idx]]; + if (!((whiteSpace_1006632971[cHEX60gensym36_469762500] != undefined))) { + break Label7; + } + + i_469762483[i_469762483_Idx] += 1; + } + } while (false); + if (((s_469762482).length <= i_469762483[i_469762483_Idx])) { + raiseException({message: (makeNimstrLit("Expected { but end reached. At offset: ") || []).concat(HEX24_335544323(i_469762483[i_469762483_Idx]) || []), parent: null, m_type: NTI1006632963, name: null, trace: [], up: null}, "JsonError"); + } + + if ((s_469762482[i_469762483[i_469762483_Idx]] == 123)) { + i_469762483[i_469762483_Idx] += 1; + } + else { + raiseException({message: (makeNimstrLit("Expected { but got ") || []).concat([s_469762482[i_469762483[i_469762483_Idx]]],makeNimstrLit(" instead. At offset: ") || [],HEX24_335544323(i_469762483[i_469762483_Idx]) || []), parent: null, m_type: NTI1006632963, name: null, trace: [], up: null}, "JsonError"); + } + + parseObjectInner_469762529(s_469762482, i_469762483, i_469762483_Idx, v_469762484); + Label9: do { + Label10: while (true) { + if (!(i_469762483[i_469762483_Idx] < (s_469762482).length)) break Label10; + var cHEX60gensym100_469762667 = s_469762482[i_469762483[i_469762483_Idx]]; + if (!((whiteSpace_1006632971[cHEX60gensym100_469762667] != undefined))) { + break Label9; + } + + i_469762483[i_469762483_Idx] += 1; + } + } while (false); + if (((s_469762482).length <= i_469762483[i_469762483_Idx])) { + raiseException({message: (makeNimstrLit("Expected } but end reached. At offset: ") || []).concat(HEX24_335544323(i_469762483[i_469762483_Idx]) || []), parent: null, m_type: NTI1006632963, name: null, trace: [], up: null}, "JsonError"); + } + + if ((s_469762482[i_469762483[i_469762483_Idx]] == 125)) { + i_469762483[i_469762483_Idx] += 1; + } + else { + raiseException({message: (makeNimstrLit("Expected } but got ") || []).concat([s_469762482[i_469762483[i_469762483_Idx]]],makeNimstrLit(" instead. At offset: ") || [],HEX24_335544323(i_469762483[i_469762483_Idx]) || []), parent: null, m_type: NTI1006632963, name: null, trace: [], up: null}, "JsonError"); + } + + } while (false); + + +} + +function parseHook_469762448(s_469762450, i_469762451, i_469762451_Idx, v_469762452, v_469762452_Idx) { + var Temporary7; + var Temporary11; + + Label1: do { + Label2: while (true) { + if (!(i_469762451[i_469762451_Idx] < (s_469762450).length)) break Label2; + var cHEX60gensym14_469762454 = s_469762450[i_469762451[i_469762451_Idx]]; + if (!((whiteSpace_1006632971[cHEX60gensym14_469762454] != undefined))) { + break Label1; + } + + i_469762451[i_469762451_Idx] += 1; + } + } while (false); + if (((s_469762450).length <= i_469762451[i_469762451_Idx])) { + raiseException({message: (makeNimstrLit("Expected [ but end reached. At offset: ") || []).concat(HEX24_335544323(i_469762451[i_469762451_Idx]) || []), parent: null, m_type: NTI1006632963, name: null, trace: [], up: null}, "JsonError"); + } + + if ((s_469762450[i_469762451[i_469762451_Idx]] == 91)) { + i_469762451[i_469762451_Idx] += 1; + } + else { + raiseException({message: (makeNimstrLit("Expected [ but got ") || []).concat([s_469762450[i_469762451[i_469762451_Idx]]],makeNimstrLit(" instead. At offset: ") || [],HEX24_335544323(i_469762451[i_469762451_Idx]) || []), parent: null, m_type: NTI1006632963, name: null, trace: [], up: null}, "JsonError"); + } + + Label3: do { + Label4: while (true) { + if (!(i_469762451[i_469762451_Idx] < (s_469762450).length)) break Label4; + Label5: do { + Label6: while (true) { + if (!(i_469762451[i_469762451_Idx] < (s_469762450).length)) break Label6; + var cHEX60gensym24_469762470 = s_469762450[i_469762451[i_469762451_Idx]]; + if (!((whiteSpace_1006632971[cHEX60gensym24_469762470] != undefined))) { + break Label5; + } + + i_469762451[i_469762451_Idx] += 1; + } + } while (false); + if (!(i_469762451[i_469762451_Idx] < (s_469762450).length)) Temporary7 = false; else { Temporary7 = (s_469762450[i_469762451[i_469762451_Idx]] == 93); } if (Temporary7) { + break Label3; + } + + var element_469762479 = [({title: [], slug: [], contentTokens: [], displayContent: []})]; + parseHook_469762480(s_469762450, i_469762451, i_469762451_Idx, element_469762479[0]); + var Temporary8 = nimCopy(null, element_469762479[0], NTI469762052); + v_469762452[v_469762452_Idx].push(Temporary8);; + Label9: do { + Label10: while (true) { + if (!(i_469762451[i_469762451_Idx] < (s_469762450).length)) break Label10; + var cHEX60gensym110_469762687 = s_469762450[i_469762451[i_469762451_Idx]]; + if (!((whiteSpace_1006632971[cHEX60gensym110_469762687] != undefined))) { + break Label9; + } + + i_469762451[i_469762451_Idx] += 1; + } + } while (false); + if (!(i_469762451[i_469762451_Idx] < (s_469762450).length)) Temporary11 = false; else { Temporary11 = (s_469762450[i_469762451[i_469762451_Idx]] == 44); } if (Temporary11) { + i_469762451[i_469762451_Idx] += 1; + } + else { + break Label3; + } + + } + } while (false); + Label12: do { + Label13: while (true) { + if (!(i_469762451[i_469762451_Idx] < (s_469762450).length)) break Label13; + var cHEX60gensym115_469762701 = s_469762450[i_469762451[i_469762451_Idx]]; + if (!((whiteSpace_1006632971[cHEX60gensym115_469762701] != undefined))) { + break Label12; + } + + i_469762451[i_469762451_Idx] += 1; + } + } while (false); + if (((s_469762450).length <= i_469762451[i_469762451_Idx])) { + raiseException({message: (makeNimstrLit("Expected ] but end reached. At offset: ") || []).concat(HEX24_335544323(i_469762451[i_469762451_Idx]) || []), parent: null, m_type: NTI1006632963, name: null, trace: [], up: null}, "JsonError"); + } + + if ((s_469762450[i_469762451[i_469762451_Idx]] == 93)) { + i_469762451[i_469762451_Idx] += 1; + } + else { + raiseException({message: (makeNimstrLit("Expected ] but got ") || []).concat([s_469762450[i_469762451[i_469762451_Idx]]],makeNimstrLit(" instead. At offset: ") || [],HEX24_335544323(i_469762451[i_469762451_Idx]) || []), parent: null, m_type: NTI1006632963, name: null, trace: [], up: null}, "JsonError"); + } + + + +} + +function fromJson_469762441(s_469762444) { + var result_469762446 = [[]]; + + var i_469762447 = [0]; + parseHook_469762448(s_469762444, i_469762447, 0, result_469762446, 0); + + return result_469762446[0]; + +} + +function onDOMLoaded(e_469762435) { + rawEcho(makeNimstrLit("loaded")); + var seachContainer_469762436 = document.getElementById("search-container"); + var searchResults_469762437 = document.createElement("div"); + searchResults_469762437.id = "search-results"; + var seachInp_469762438 = document.createElement("input"); + seachInp_469762438.setAttribute("type", "text"); + seachInp_469762438.setAttribute("placeholder", "Search"); + var dbString_469762439 = null; + var request = new XMLHttpRequest(); + request.open("GET", "search.json", false); + request.send(null); + dbString_469762439 = request.responseText + + var s_469762440 = cstrToNimstr(dbString_469762439); + searchDB_469762065[0] = nimCopy(null, fromJson_469762441(s_469762440), NTI469762054); + seachInp_469762438.addEventListener("keyup", onInput, false); + seachContainer_469762436.appendChild(seachInp_469762438); + seachContainer_469762436.appendChild(searchResults_469762437); + + +} +window.addEventListener("DOMContentLoaded", onDOMLoaded, false); diff --git a/pkg/generator.go b/pkg/generator.go deleted file mode 100644 index 680e145..0000000 --- a/pkg/generator.go +++ /dev/null @@ -1,317 +0,0 @@ -package pkg - -import ( - "fmt" - "io" - "log" - "os" - "regexp" - "strings" - - "github.com/barelyhuman/commitlog/v3/lib" - "github.com/go-git/go-git/v5" - "github.com/go-git/go-git/v5/plumbing/object" -) - -// commitsByCategory is a collection of commits by a given key -// the _key_ can be `all-changes` or a dynamic key / pattern defined -// by the user -type commitsByCategory struct { - key string - commits []string -} - -type Generator struct { - repo *git.Repository - dirPath string - startRef string - endRef string - addPromo bool - categories []string - output struct { - stdio bool - file bool - filePath string - } - classifiedCommits []commitsByCategory - rawCommits []*object.Commit -} - -type GeneratorConfigMod func(*Generator) - -func (g *Generator) openRepo() { - if g.repo != nil { - return - } - - r, err := git.PlainOpen(g.dirPath) - if err != nil { - log.Fatal("Error opening Repository: ", err) - } - g.repo = r -} - -func (g *Generator) readCommitsInTags() (err error) { - // make sure the repo is open - g.openRepo() - - var commits []*object.Commit - - var latestTagCommit *object.Commit - var previousTagCommit *object.Commit - - commitsIter, err := g.repo.Log(&git.LogOptions{}) - if err != nil { - err = fmt.Errorf("[commitlog] Failed to get commits from given hash %v", err) - return - } - defer commitsIter.Close() - - // loop through the commits to get the - // most recent tagged commit and the 2nd most recent - // tagged commit - for { - c, err := commitsIter.Next() - - if err == io.EOF { - break - } - - isTag := lib.IsHashATag(g.repo, c.Hash) - if isTag { - if latestTagCommit == nil { - latestTagCommit = c - } else if previousTagCommit == nil { - previousTagCommit = c - break - } - } - } - - if latestTagCommit == nil && previousTagCommit == nil { - err = fmt.Errorf("failed to get tags, check if you have at least one tag or provide commit references instead") - return - } - - commitsIter, err = g.repo.Log(&git.LogOptions{From: latestTagCommit.Hash}) - - if err != nil { - err = fmt.Errorf("[commitlog] Failed to get commits from given hash %v", err) - return - } - defer commitsIter.Close() - - for { - c, err := commitsIter.Next() - - if err == io.EOF { - break - } - - // do not include the last matching commit - if previousTagCommit != nil && c.Hash == previousTagCommit.Hash { - break - } - - commits = append(commits, c) - } - - // this will either have commits between 2 tags or all commits if no tags exist - g.rawCommits = commits - - return - -} - -func (g *Generator) readCommitsInRange() (err error) { - // make sure the repo is open - g.openRepo() - - var commits []*object.Commit - var commitsIter object.CommitIter - - startHash := lib.GetCommitFromString(g.repo, g.startRef) - endHash := lib.GetCommitFromString(g.repo, g.endRef) - - if startHash != nil { - commitsIter, err = g.repo.Log(&git.LogOptions{From: startHash.Hash}) - } else { - commitsIter, err = g.repo.Log(&git.LogOptions{}) - } - - if err != nil { - err = fmt.Errorf("[commitlog] Failed to get commits from given hash %v", err) - return - } - - for { - c, err := commitsIter.Next() - - if err == io.EOF { - break - } - - if endHash != nil && c.Hash == endHash.Hash { - break - } - - commits = append(commits, c) - } - - g.rawCommits = commits - - return - -} - -// ReadCommmits will try to collect commits in the given range -// or default to current tag to the previous tag or current commit to -// recent tag, in the same order of priority -func (g *Generator) ReadCommmits() (err error) { - // make sure the repo is open - g.openRepo() - - if len(g.startRef) > 0 || len(g.endRef) > 0 { - err = g.readCommitsInRange() - if err != nil { - return - } - } else { - err = g.readCommitsInTags() - if err != nil { - return - } - } - - return -} - -func (g *Generator) Classify() (err error) { - // write the classification using the existing commits - if len(g.categories) == 0 { - allCommits := []string{} - - for _, commit := range g.rawCommits { - allCommits = append(allCommits, lib.CommitToLog(commit)) - } - - g.classifiedCommits = []commitsByCategory{ - { - key: "All Changes", - commits: allCommits, - }, - } - - return - } - - for _, catg := range g.categories { - rgx, err := regexp.Compile(catg) - if err != nil { - break - } - - catgCommits := []string{} - - for _, commit := range g.rawCommits { - if !rgx.Match([]byte(commit.Message)) { - continue - } - - catgCommits = append(catgCommits, lib.CommitToLog(commit)) - } - - g.classifiedCommits = append(g.classifiedCommits, commitsByCategory{ - key: catg, - commits: catgCommits, - }) - } - - return - -} - -func (g *Generator) Generate() (err error) { - - var inMardown strings.Builder - - for _, class := range g.classifiedCommits { - - // title - inMardown.Write([]byte("##")) - inMardown.Write([]byte(" ")) - inMardown.Write([]byte(class.key)) - - inMardown.Write([]byte("\n")) - - // each commit with 2 returns to separate the long description one's - for _, commitMsg := range class.commits { - inMardown.Write([]byte(commitMsg)) - inMardown.Write([]byte("\n\n")) - } - - } - - if g.output.stdio { - fmt.Println(inMardown.String()) - } - - if g.output.file { - err = os.WriteFile(g.output.filePath, []byte(inMardown.String()), os.ModePerm) - if err != nil { - return - } - } - - return -} - -func CreateGenerator(path string, mods ...GeneratorConfigMod) *Generator { - generator := &Generator{ - dirPath: path, - } - - for _, mod := range mods { - mod(generator) - } - - return generator -} - -func WithPromo() GeneratorConfigMod { - return func(g *Generator) { - g.addPromo = true - } -} - -func WithOutputToFile(filePath string) GeneratorConfigMod { - return func(g *Generator) { - g.output.file = true - g.output.filePath = filePath - } -} - -func WithOutputToStdio() GeneratorConfigMod { - return func(g *Generator) { - g.output.stdio = true - } -} - -func WithStartReference(startRef string) GeneratorConfigMod { - return func(g *Generator) { - g.startRef = startRef - } -} - -func WithEndReference(endRef string) GeneratorConfigMod { - return func(g *Generator) { - g.endRef = endRef - } -} - -func WithCategories(categories string) GeneratorConfigMod { - return func(g *Generator) { - parts := strings.Split(categories, ",") - g.categories = parts - } -} diff --git a/pkg/releaser.go b/pkg/releaser.go deleted file mode 100644 index 22997e3..0000000 --- a/pkg/releaser.go +++ /dev/null @@ -1,191 +0,0 @@ -package pkg - -import ( - "fmt" - "strconv" - "strings" - - "golang.org/x/mod/semver" -) - -type version struct { - major int - minor int - patch int - preString string -} - -type Releaser struct { - raw string - v version - next version - preTag string -} - -func (r *Releaser) HasPrerelease() bool { - return len(r.v.preString) > 0 -} - -func (r *Releaser) String() (s string) { - var b strings.Builder - - b.Write([]byte("v")) - - b.WriteString(strconv.Itoa(r.next.major)) - b.WriteString(".") - b.WriteString(strconv.Itoa(r.next.minor)) - b.WriteString(".") - b.WriteString(strconv.Itoa(r.next.patch)) - - if len(r.next.preString) > 0 { - b.Write([]byte("-")) - b.Write([]byte(r.next.preString)) - } - - s = b.String() - - return -} - -type ReleaserMod func(*Releaser) - -func CreateNewReleaser(vString string, mods ...ReleaserMod) (r *Releaser, err error) { - - if !semver.IsValid(vString) { - err = fmt.Errorf("invalid version string") - return - } - - r = &Releaser{} - r.raw = vString - - simplifiedV := semver.Canonical(vString) - - vParts := strings.Split(simplifiedV, ".") - - preParts := strings.Split(vParts[2], "-") - - if len(preParts) > 1 { - r.v.patch, err = strconv.Atoi(preParts[0]) - } else { - r.v.patch, err = strconv.Atoi(vParts[2]) - } - - if err != nil { - return - } - - r.v.minor, err = strconv.Atoi(vParts[1]) - if err != nil { - return - } - - majorStr := strings.Replace(vParts[0], "v", "", -1) - r.v.major, err = strconv.Atoi(majorStr) - if err != nil { - return - } - - r.v.preString = semver.Prerelease(vString) - - r.preTag = strings.Split(r.v.preString, ".")[0] - - r.next.major = r.v.major - r.next.minor = r.v.minor - r.next.patch = r.v.patch - r.next.preString = r.v.preString - - for _, mod := range mods { - mod(r) - } - - return -} - -func WithPrerelease(pre string) ReleaserMod { - return func(r *Releaser) { - r.next.preString = pre - } -} - -func WithPrereleaseIncrement() ReleaserMod { - return func(r *Releaser) { - - // if a pre string already exists - if r.HasPrerelease() { - preParts := strings.Split(r.v.preString, ".") - prePointer, _ := strconv.Atoi(preParts[1]) - prePointer += 1 - preParts[1] = strconv.Itoa(prePointer) - preParts[0] = r.preTag - r.next.preString = strings.Join(preParts[:], ".") - return - } - - preToCreate := []string{ - r.preTag, - "0", - } - - r.next.preString = strings.Join(preToCreate[:], ".") - } -} - -func WithMajorIncrement() ReleaserMod { - return func(r *Releaser) { - r.next.major += 1 - } -} - -func WithMinorIncrement() ReleaserMod { - return func(r *Releaser) { - r.next.minor += 1 - } -} - -func WithPatchIncrement() ReleaserMod { - return func(r *Releaser) { - r.next.patch += 1 - } -} - -func WithMajorReset() ReleaserMod { - return func(r *Releaser) { - r.next.major = 0 - } -} - -func WithMinorReset() ReleaserMod { - return func(r *Releaser) { - r.next.minor = 0 - } -} - -func WithPatchReset() ReleaserMod { - return func(r *Releaser) { - r.next.patch = 0 - } -} - -func WithPrereleaseReset() ReleaserMod { - return func(r *Releaser) { - preParts := strings.Split(r.v.preString, ".") - // reset something like `beta.1` to `beta.0` - preParts[1] = strconv.Itoa(0) - nextPreString := strings.Join(preParts[:], ".") - nextPreString = strings.TrimPrefix(nextPreString, "-") - r.next.preString = nextPreString - } -} - -func WithClearPrerelease() ReleaserMod { - return func(r *Releaser) { - r.next.preString = "" - } -} - -func WithPreTag(preTag string) ReleaserMod { - return func(r *Releaser) { - r.preTag = preTag - } -} diff --git a/scripts/cross-compile.sh b/scripts/cross-compile.sh deleted file mode 100755 index 3ac43fd..0000000 --- a/scripts/cross-compile.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env bash - -set -euxo pipefail - -rm -rf ./bin - -build_commands=(' - apk add make curl git \ - ; GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -o bin/linux-arm64/alvu \ - ; GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o bin/linux-amd64/alvu \ - ; GOOS=linux GOARCH=arm go build -ldflags="-s -w" -o bin/linux-arm/alvu \ - ; GOOS=windows GOARCH=386 go build -ldflags="-s -w" -o bin/windows-386/alvu \ - ; GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o bin/windows-amd64/alvu \ - ; GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -o bin/darwin-amd64/alvu \ - ; GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" -o bin/darwin-arm64/alvu -') - -# run a docker container with osxcross and cross compile everything -docker run -it --rm -v $(pwd):/usr/local/src -w /usr/local/src \ - golang:alpine3.16 \ - sh -c "$build_commands" - -# create archives -cd bin -for dir in $(ls -d *); -do - cp ../README.md $dir - cp ../LICENSE $dir - mkdir -p $dir/docs - cp -r ../docs/* $dir/docs - - # remove the download document and styles - rm -rf $dir/docs/download.md - rm -rf $dir/docs/styles.css - - tar cfzv "$dir".tgz $dir - rm -rf $dir -done -cd .. \ No newline at end of file diff --git a/scripts/generate-docs.sh b/scripts/generate-docs.sh deleted file mode 100755 index ee3c79a..0000000 --- a/scripts/generate-docs.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -curl -o mudkip.tgz -L https://github.com/barelyhuman/mudkip/releases/latest/download/linux-amd64.tgz -tar -xvzf mudkip.tgz -install linux-amd64/mudkip /usr/local/bin - -mudkip --baseurl='/commitlog/' --stylesheet="./docs/styles.css" - - diff --git a/scripts/get-release-urls.sh b/scripts/get-release-urls.sh deleted file mode 100755 index 959994f..0000000 --- a/scripts/get-release-urls.sh +++ /dev/null @@ -1,27 +0,0 @@ - -#!/usr/bin/env bash - -curl -sL https://api.github.com/repos/barelyhuman/commitlog/releases | jq '[ .[0].assets[] | {name:.name,url:.url} ]' > api_urls.json - -cat >./docs/download.md< -Codestin Search App - - - -### [commitlog](/) - -[Home](/) [Manual](/manual) [Download](/download) [API](/api) - -#### Downloads - -EOF - -jq -c '.[]' api_urls.json | while read i; do - url=$(echo $i | jq '.url' --raw-output) - name=$(echo $i | jq '.name' --raw-output) - bdurl=$(curl -sL $url | jq -r '.browser_download_url') - echo "[$name]($bdurl) " >> ./docs/download.md -done \ No newline at end of file diff --git a/search.json b/search.json new file mode 100644 index 0000000..9248c97 --- /dev/null +++ b/search.json @@ -0,0 +1 @@ +[{"title": "docs/download.md", "slug": "download.html", "contentTokens": ["", "Codestin Search App", "", "", "", "### [commitlog](/commitlog/)", "", "[Home](/commitlog/) [Manual](/commitlog/manual) [Download](/commitlog/download) [API](/commitlog/api)", "", "#### Downloads", "", "[commitlog-v3.0.0-darwin-amd64.tar.gz](https://github.com/barelyhuman/commitlog/releases/download/v3.0.0/commitlog-v3.0.0-darwin-amd64.tar.gz) ", "[commitlog-v3.0.0-darwin-amd64.tar.gz.md5](https://github.com/barelyhuman/commitlog/releases/download/v3.0.0/commitlog-v3.0.0-darwin-amd64.tar.gz.md5) ", "[commitlog-v3.0.0-darwin-arm64.tar.gz](https://github.com/barelyhuman/commitlog/releases/download/v3.0.0/commitlog-v3.0.0-darwin-arm64.tar.gz) ", "[commitlog-v3.0.0-darwin-arm64.tar.gz.md5](https://github.com/barelyhuman/commitlog/releases/download/v3.0.0/commitlog-v3.0.0-darwin-arm64.tar.gz.md5) ", "[commitlog-v3.0.0-linux-386.tar.gz](https://github.com/barelyhuman/commitlog/releases/download/v3.0.0/commitlog-v3.0.0-linux-386.tar.gz) ", "[commitlog-v3.0.0-linux-386.tar.gz.md5](https://github.com/barelyhuman/commitlog/releases/download/v3.0.0/commitlog-v3.0.0-linux-386.tar.gz.md5) ", "[commitlog-v3.0.0-linux-amd64.tar.gz](https://github.com/barelyhuman/commitlog/releases/download/v3.0.0/commitlog-v3.0.0-linux-amd64.tar.gz) ", "[commitlog-v3.0.0-linux-amd64.tar.gz.md5](https://github.com/barelyhuman/commitlog/releases/download/v3.0.0/commitlog-v3.0.0-linux-amd64.tar.gz.md5) ", "[commitlog-v3.0.0-linux-arm64.tar.gz](https://github.com/barelyhuman/commitlog/releases/download/v3.0.0/commitlog-v3.0.0-linux-arm64.tar.gz) ", "[commitlog-v3.0.0-linux-arm64.tar.gz.md5](https://github.com/barelyhuman/commitlog/releases/download/v3.0.0/commitlog-v3.0.0-linux-arm64.tar.gz.md5) ", "[commitlog-v3.0.0-windows-386.zip](https://github.com/barelyhuman/commitlog/releases/download/v3.0.0/commitlog-v3.0.0-windows-386.zip) ", "[commitlog-v3.0.0-windows-386.zip.md5](https://github.com/barelyhuman/commitlog/releases/download/v3.0.0/commitlog-v3.0.0-windows-386.zip.md5) ", "[commitlog-v3.0.0-windows-amd64.zip](https://github.com/barelyhuman/commitlog/releases/download/v3.0.0/commitlog-v3.0.0-windows-amd64.zip) ", "[commitlog-v3.0.0-windows-amd64.zip.md5](https://github.com/barelyhuman/commitlog/releases/download/v3.0.0/commitlog-v3.0.0-windows-amd64.zip.md5) ", ""]}, {"title": "docs/api.md", "slug": "api.html", "contentTokens": ["", "Codestin Search App", "", "", "", "### [commitlog](/commitlog/)", "", "[Home](/commitlog/) [Manual](/commitlog/manual) [Download](/commitlog/download) [API](/commitlog/api)", "", "# API", "", "### General Guide", "", "commitlog also comes as a pkg that you could reuse to modify the behaviour of", "the commands and this is very limited at the moment since I'm still working on", "the best way to get plugins to work with the original CLI instead of having to", "write your own version of commitlog.", "", "The pkg contains the 2 base command's creators and behaviour modifiers", " or more", "commonly known as the golang options pattern.", "", "Briefly put", " You have one function that takes in unlimited amount of functions", "as parameter with each of these parameter functions being able to modify the", "behaviour of the returned instance.", "", "Easy way to explain this is with an example of the `releaser` API", "", "```go", "package main", "", "import (", "", "\"log\"", "", "", "\"github.com/barelyhuman/commitlog/v3/pkg\"", ")", "", "func main() {", "", "versionString := \"v0.0.1\"", "", "releaser", " _ := pkg.CreateNewReleaser(", "", "", "versionString", "", "", "", "pkg.WithMajorIncrement()", "", "", ")", "", "", "log.Println(releaser.String())", "", "}", "```", "", "here the `pkg.CreateNewReleaser` takes in one mandatory value which is the", "`versionString` and the 2nd parameter is optional here.", "", "Though", " since we wish for the releaser to have a custom behaviour everytime the", "flags change", " instead of writing entire functionalities inside various releaser", "functions", " which would look like so", "", "```go", "releaser.IncrementMajor()", "releaser.IncrementMinor()", "```", "", "I'd be unable to expose the builders / option functions out to the public for", "them to write custom behaviours that work directly with the `struct` being used", "by commitlog itself and instead you'd be writing wrappers around existing", "functions. Thus", " adding another layer of abstraction which isn't needed for", "something that wants to be extended.", "", "This approach gives me the ability to expose a selected few properties for you", "to modify while writing your own builder/option function.", "", "The only pointer functions that releaser has is the one's that'll help with", "printing or identifying the final version's state.", "", "Since", " you now know how the API is written", " the go doc for this module should be", "able to help you with the remaining.", "", "[godoc↗](https://pkg.go.dev/github.com/barelyhuman/commitlog)", "", "> **Note**: if the go doc still hasn't been generated for v2.0.0", " please go", "> through the source code to help you with the implementation details", ""]}, {"title": "docs/index.md", "slug": "index.html", "contentTokens": ["", "Codestin Search App", "", "", "", "### [commitlog](/commitlog/)", "", "[Home](/commitlog/) [Manual](/commitlog/manual) [Download](/commitlog/download) [API](/commitlog/api)", "", "#### Index", "", "- [Source](https://github.com/barelyhuman/commitlog)", "- [Quick Start](#quick-start)", "- [About](#about)", " - [Philosophy](#philosophy)", " - [Installation](#installation)", "- [Manual](/commitlog/manual)", "- [License](#license)", "", "

Quick Start

", "", "For the one's who already know the tool and wanna get started quickly.", "", "You can get the CLI in the following ways", "", "1. You can get the binaries from the [download section](/commitlog/download)", "", "2. Using `go get`", "", "```sh", "go get -u github.com/barelyhuman/commitlog/v3", "```", "", "3. Using goblin", "", "```sh", "curl -sf https://goblin.run/github.com/barelyhuman/commitlog/v3@v3 | sh", "```", "", "Once installed you can just run `commitlog generate` or the shorter version", "`commitlog g` to get all the changes between the recent tags.", "", "

About

", "", "
Philosophy
", "", "**_commitlog_** simply exists because I wasn't able to find a decent enough tool", "to do this without being bound to a specific programming language and it's", "toolset. The closes one to this is the `git`'s own `shortlog` and `log` commands", "", "- **Language Agnostic** - No one needs the entire programming toolset or the", " language to be setup on the system to be able to just generate logs", "", "- **Decently Sized** - Not everyone has a powerful system and CI systems are", " still very limited in terms of resources since they give you shared spaces and", " automating generating this is a common practice so it doesn't make sense for", " it to install a runtime worth 100MB to run it.", "", " The binary itself is around 10-13MB which is fairly big for a tool like this", " but this is due to go's nature of embedding the platform runtime with the", " binary and this might not be ideal for some and so there's another similar", " smaller scoped version [nimclog](https://github.com/barelyhuman/nimclog) which", " is in KB's", "", "- **Flexible** - There are no set standards for how you write commit messages.", " Commitlint is a good standard and pretty widely used and also what commitlog", " v1 used as the base for categorizing.", "", " V2 however", " doesn't have a set commit category standard", " it accepts regex's", " that you will categorize your commits for you.", "", " This is more for experienced developers who have a their own pattern of", " writing commits and would like a tool that'd work with their pattern instead", " of creating friction", "", "- **Extensible** - The entire thing is open source and MIT licenses", "", " specifically for you to be able to fix and add things as needed. Each command", " has been kept away from the domain logic to be able to use `commitlog` even as", " a library and build your own tool if you wish to", " though if there's something", " you wish the CLI supported", " you are free to open issues and I really like", " people helping with the development since that helps keeping the tool alive", " longer.", "", "
Installation
", "", "The installation is pretty straightforwad. You [download](/commitlog/download) the binary", "from the download section of this website or use something like", "[goblin](https://goblin.run) to build the binary for your specific", "system (rarely needed) since the releases actually accommodate the most used", "operating systems and architectures already.", "", "**Linux/Mac (Unix Systems)**", "", "Once downloaded", " you can use the `install` command on \\*nix systems to link the", "binary to a location that's already in your PATH variable.", "", "eg:", "", "```bash", "# install commitlog from current directory to the /usr/local/bin directory", "install $(pwd)/commitlog /usr/local/bin", "```", "", "This should give you the ability to use the `commitlog` command anywhere in your", "system", "", "**Windows**", "", "Similar to the linux setup", " you can download the `.exe` file and add it to a", "location that your environment path already has. An easier thing to do is to", "store the entire thing in your secondary partition and add that location to your", "PATH. You can use this resource from Java docs to help you with modifying the", "PATH variables", "", "- [Modifying PATH in Windows](https://www.java.com/en/download/help/path.html)", "", "

Manual

", "", "[Read Manual →](/commitlog/manual)", "", "

License

", "", "commitlog is MIT Licensed and you can read the entire license in the", "[source code](https://github.com/barelyhuman/commitlog)", ""]}, {"title": "docs/manual.md", "slug": "manual.html", "contentTokens": ["", "Codestin Search App", "", "", "", "### [commitlog](/commitlog/)", "", "[Home](/commitlog/) [Manual](/commitlog/manual) [Download](/commitlog/download) [API](/commitlog/api)", "", "# Manual", "", "- [Basics](#basics)", " - [generate](#generate)", " - [release](#release)", "- [Advanced](#advanced)", " - [Selective Log Ranges](#selective-log-ranges)", " - [From a different repo](#from-a-different-repo)", " - [Categorize](#categorize)", "- [CLI](#cli)", "- [API](/commitlog/api)", "", "

Basics

", "", "**_`commitlog`_** come with 2 basic functionalities", "", "- Generating commits as changelogs in markdown", "- Managing your version and tags", "", "Both the above are available as sub commands and we'll go through each one by", "one.", "", "Just running `commitlog` no longer works as it did in v1", " you'll need to specify", "a sub command to get it working.", "", "This has been done to keep it simpler to keep arbitrary behaviour to a minimum", "", "

generate

", "", "The first one is `generate` and in most cases you'll just be using this to", "handle generation of commits as a list of markdown notes", "", "Here's an example of what it'll look like to run the `generate` sub-command", "", "```sh", "$ commitlog generate", "# or ", "$ commitlog g", "```", "", "**Output**:", "", "```md", "## All Changes", "87ce3fc76b252908cdd81f9537713f8d67813652 chore: v2.0.0-beta.0", "", "09fc85c0d1d52d770bbbf39ac45907103a53d354 refactor: swap go-git for push with exec", "", "5bafe9d105298001707c7c816e60d3ef0257a816 fix: tag creation", "", "909fd032facdeb4fb7633a4fad82dced28e8de83 chore: swap debugging logger with stderr printer", "", "```", "", "The behaviour of the `generate` command is like so", "", "- go through all commits from the current `HEAD` (commit with the `HEAD`", " reference) till the last commit or the most recent tagged commit.", "- the other case is where if the latest commit is also a tagged commit", " it'll", " still go till the most recent tagged commit.", "", " eg: v0.0.2 -> HEAD", " v0.0.1 -> SOMEHASH", " would give you the commits between", " both the tags.", "", "The default behaviour of **_commitlog_** is to print to the stdout of your", "terminal which might not be what you wish to do.", "", "So", " if you wish to ever write to a file ", " you can use the `--out FILE` flag to", "write the output to a file instead.", "", "```sh", "$ commitlog g -o ./CHANGELOG.md", "```", "", "> **Note**: commitlog will overwrite the file with the new output", " make sure you", "> create a backup of the file when working with this.", "", "> **Note**: In coming versions an append mode will be added to the CLI to avoid", "> having to deal with this manually", "", "

release

", "", "The `release` sub-command is a complimentary sub-command added to commitlog to", "help you with managing release versions. I understand that most languages have", "their own package version management and you might want to work with them but", "that's also why the `release` sub-command isn't something you need", " it's there", "for cases where you might wanna use it.", "", "My primary usecase is when working with repositories that work with multiple", "languages and I'd prefer a unified version.", "", "The `release` command doesn't modify your source code files but instead handles", "the version with it's own file named `.commitlog.release`", " which just holds the", "**version** number right now and while this does have the X.X.X format (semantic", "versioning format) the increments or how you handle them doesn't have to be.", "", "The command is flexible enough for you to combine and create your own way of", "versioning.", "", "##### Initialize", "", "```sh", "$ commitlog release --init", "# or ", "$ commitlog r --init", "```", "", "Once initialized", " you'll see a `.commitlog.release` file in your repo with the", "version `v0.0.0` to start with.", "", "##### Increments", "", "Post that you can use the remaining flags to help you incrementing the version", "as needed.", "", "```sh", "$ commitlog r --major # change to v1.0.0", "$ commitlog r --minor # change to v0.1.0", "$ commitlog r --patch # change to v0.0.1", "$ commitlog r --pre # change to v0.0.0-beta.0", "$ commitlog r --pre --pre-tag=\"dev\" # change to v0.0.0-dev.0", "", "# or go bonkers ", "$ commitlog r --patch --pre --pre-tag=\"dev\" # change to v0.0.1-dev.0", "$ commitlog r --major --patch --pre --pre-tag=\"dev\" # change to v1.0.1-dev.0", "```", "", "#### Git actions", "", "Most times you'd also want a tool like this to create commits and tags for you", "which is fair", " so `release` does come with a few git actions.", "", "- `--commit` (will create a commit and tag it for you)", "- `--push` (will push the commits and tags for you)", "", "The whole command would look a little something like this", "", "```sh", "$ commitlog r --patch --commit --push", "```", "", "

Advanced

", "", "These are not really hard to guess or achieve but are in the advanced section as", "this isn't something a beginner user might need to mess with. If you have other", "use cases that you feel like should be added here", " raise a issue.", "", "

Selective Log Ranges

", "There's enough cases where the entire history between the tags makes no sense. You might just want a specific set of commits and this is very easy to do with commitlog", "", "```sh", "$ commitlog g --start HEAD --end HEAD~3 ", "# would return the last 3 commits", "```", "", "And as you might have understood", " commitlog does work with git's revision system", "so you can reuse git's own revision pointers as needed. Though it's mostly", "easier to just use the HASH since", " finding the hashes in `git log` is easier", "than finding the number you have to type after the `HEAD~`", "", "

From a different repo

", "A lot more often you might need to generate logs for a sub-repo when working with a huge multirepo folder which a lot of sub-modules and switching worktree for the changelog might not be something you wish to do.", "", "In cases like these the `-p` or `--path` flag can be used with the `generate`", "flag", "", "```sh", "$ commitlog g -p ./sub/module -s HEAD~3 ", "# would return the commits from HEAD~3 to the next tag or end of all commits.", "```", "", "

Categorize

", "You wouldn't be using commitlog otherwise so this obviously has to exist.", "", "As for why is this turned off by default? I just don't use commit standards and", "mostly just need the commits between tags and very rarely need the categories to", "help me but doesn't change the fact that someone else might need it.", "", "So", " how does commitlog categorize? using regex's ", " or more like comma seperated", "regex's.", "", "The implementation approach might bring some issue but I'm going to wait for", "them instead of over fixing something that might never really happen.", "", "Anyway", " a simple example for a non-scoped commitlint styled categorization would", "look something like this .", "", "```sh", "$ commitlog g --categories=\"feat:", "fix:\"", "```", "", "**Output:**", "", "```md", "## feat:", "110c9b260e6de1e2be9af28b3592c373ab6fc501 feat: handling for pre increment", "", "9080580575d3579b3d11dd114830eb128f0c8130 feat: releaser base maj", "min", "patch setup", "", "b513e53cbbc30e5b667fbba373b9589911a47ac0 feat: generator subcommand implementation", "", "## fix:", "5bafe9d105298001707c7c816e60d3ef0257a816 fix: tag creation", "```", "", "This could be made a little more neater using a better regex like so", "", "```sh", "$ commitlog g --categories=\"^feat", "^fix\"", "```", "", "**Output**:", "", "```md", "## ^feat", "e0ce9c693c554158b7b4841b799524164d9c3e83 feat(releaser): add init and pre-tag handlers", "", "110c9b260e6de1e2be9af28b3592c373ab6fc501 feat: handling for pre increment", "", "9080580575d3579b3d11dd114830eb128f0c8130 feat: releaser base maj", "min", "patch setup", "", "b513e53cbbc30e5b667fbba373b9589911a47ac0 feat: generator subcommand implementation", "", "## ^fix", "5bafe9d105298001707c7c816e60d3ef0257a816 fix: tag creation", "", "540bb3d7419aab314fdb999dd57eeac3c53f5fad fix doc generation", "", "87d40ddbd463ad71b3af8b7edb8ac8176ecbf2f5 fix tests for new param", "```", "", "As visible", " you find more commits in the 2nd one since the regex matches more", "cases and gives you more information. You are free to modify these to make them", "work with other patterns that you might follow.", "", "Also the titles are going to be the regex's you pass. A future version will add", "a way for you to add label's to the regex though that's a little harder to", "achieve without making the flags very verbose so I've avoided it for now.", "", "> **Note**: This is the initial implementation of this and might change in a", "> future major version since this flag feels a little more frictional than the", "> other approaches I have in mind. Feel free to recommend other ways to do this.", "", "

CLI

", "", "This is the entire CLI reference", " which you can also access by using the `-h`", "flag on the downloaded binary.", "", "**`commitlog -h`**", "", "```", "NAME:", " commitlog - commits to changelogs", "", "USAGE:", " commitlog [global options] command [command options] [arguments...]", "", "COMMANDS:", " generate", " g commits to changelogs", " release", " r manage .commitlog.release version", " help", " h Shows a list of commands or help for one command", "", "GLOBAL OPTIONS:", " --help", " -h show help (default: false)", "```", "", "---", "", "**`commitlog g -h`**", "", "```", "NAME:", " commitlog generate - commits to changelogs", "", "USAGE:", " commitlog generate [command options] [arguments...]", "", "OPTIONS:", " --categories value categories to use", " includes all commits by default. any text you add here will be used to create categories out of the commits", " --end END", " -e END END reference for the commit to stop including commits at.This is exclusive of the given commit reference", " --out FILE", " -o FILE path to the output FILE", " --path PATH", " -p PATH root with the '.git' folder PATH (default: \".\")", " --promo add promo text to the end of output (default: false)", " --start START", " -s START START reference for the commit to include commits from", "This is inclusive of the given commit reference", " --stdio print to the stdout (default: true)", "```", "", "---", "", "**`commitlog r -h`**", "", "```", "NAME:", " commitlog release - manage .commitlog.release version", "", "USAGE:", " commitlog release [command options] [arguments...]", "", "OPTIONS:", " --commit if true will create a commit and tag", " of the changed version (default: false)", " --init initialise commitlog release (default: false)", " --major create a major version (default: false)", " --minor create a minor version (default: false)", " --patch create a patch version (default: false)", " --path PATH", " -p PATH PATH to a folder where .commitlog.release exists or is to be created.(note: do not use `--commit` or `--push` if the file isn't in the root) (default: \".\")", " --pre create a pre-release version. will default to patch increment unlessspecified and not already a pre-release (default: false)", " --pre-tag value create a pre-release version (default: \"beta\")", " --push if true will create push the created release commit + tag on origin (default: false)", "```", ""]}] \ No newline at end of file diff --git a/docs/styles.css b/style.css similarity index 100% rename from docs/styles.css rename to style.css