Skip to content

Commit

Permalink
fix typos (#158)
Browse files Browse the repository at this point in the history
* Fix some typos in code and documentation

* Fix acronyms in code and documentation

Some are registered tradmarks.
  • Loading branch information
ccoVeille authored Jul 3, 2024
1 parent f7f622d commit e76ff39
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

NOTE: As semantic versioning states all 0.y.z releases can contain breaking changes in API (flags, grpc API, any backward compatibility)
NOTE: As semantic versioning states all 0.y.z releases can contain breaking changes in API (flags, gRPC API, any backward compatibility)

We use *breaking* word for marking changes that are not backward compatible (relates only to v0.y.z releases.)

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/github.com/bwplotka/mdox) [![Latest Release](https://img.shields.io/github/release/bwplotka/mdox.svg?style=flat-square)](https://github.com/bwplotka/mdox/releases/latest) [![CI](https://github.com/bwplotka/mdox/workflows/go/badge.svg)](https://github.com/bwplotka/mdox/actions?query=workflow%3Ago) [![Go Report Card](https://goreportcard.com/badge/github.com/bwplotka/mdox)](https://goreportcard.com/report/github.com/bwplotka/mdox) [![Slack](https://img.shields.io/badge/join%20slack-%23mdox-brightgreen.svg)](https://cloud-native.slack.com/archives/mdox)

`mdox` (spelled as `md docs`) is a CLI for maintaining automated, high-quality project documentation and website leveraging [Github Flavored Markdown](https://github.github.com/gfm/) and git.
`mdox` (spelled as `md docs`) is a CLI for maintaining automated, high-quality project documentation and website leveraging [GitHub Flavored Markdown](https://github.github.com/gfm/) and git.

This project can be used both as CLI as well as a library.

Expand Down Expand Up @@ -34,7 +34,7 @@ For example, this README is formatted by the CI on every PR using [`mdox fmt -l
```bash mdox-exec="mdox fmt --help"
usage: mdox fmt [<flags>] <files>...

Formats in-place given markdown files uniformly following GFM (Github Flavored
Formats in-place given markdown files uniformly following GFM (GitHub Flavored
Markdown: https://github.github.com/gfm/). Example: mdox fmt *.md


Expand Down Expand Up @@ -177,7 +177,7 @@ So passing in regex such as `--links.localize.address-regex="https:\/\/example\.
### Transformation
mdox allows various types of markdown file transformation which are useful for website pre-processing and is often required when using static site generators like Hugo. It helps in generating front/backmatter, renaming and moving files, and converts links to work on websites.
mdox allows various types of markdown file transformation which are useful for website pre-processing and is often required when using static site generators like Hugo. It helps in generating front/backmatter, renaming, and moving files, and converts links to work on websites.
Just run `mdox transform --config-file=.mdox.yaml` and pass in YAML configuration.
Expand Down Expand Up @@ -280,7 +280,7 @@ YAML can be passed in directly as well using `--config` flag! For more details [
Requirements to build this tool:
* Go 1.19+
* Linux or MacOS
* Linux or macOS
```shell
go install github.com/bwplotka/mdox@latest
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ func interrupt(logger log.Logger, cancel <-chan struct{}) error {
}

func registerFmt(_ context.Context, app *extkingpin.App, metricsPath *string) {
cmd := app.Command("fmt", "Formats in-place given markdown files uniformly following GFM (Github Flavored Markdown: https://github.github.com/gfm/). Example: mdox fmt *.md")
cmd := app.Command("fmt", "Formats in-place given markdown files uniformly following GFM (GitHub Flavored Markdown: https://github.github.com/gfm/). Example: mdox fmt *.md")
files := cmd.Arg("files", "Markdown file(s) to process.").Required().ExistingFiles()
checkOnly := cmd.Flag("check", "If true, fmt will not modify the given files, instead it will fail if files needs formatting").Bool()
softWraps := cmd.Flag("soft-wraps", "If true, fmt will preserve soft line breaks for given files").Bool()
Expand Down
6 changes: 3 additions & 3 deletions pkg/mdformatter/linktransformer/link.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ func NewValidator(ctx context.Context, logger log.Logger, linksValidateConfig []
}

// Set very soft limits.
// E.g github has 50-5000 https://docs.github.com/en/free-pro-team@latest/rest/reference/rate-limit limit depending
// on api (only search is below 100).
// E.g GitHub has 50-5000 https://docs.github.com/en/free-pro-team@latest/rest/reference/rate-limit limit depending
// on API (only search is below 100).
if config.Timeout != "" {
v.c.SetRequestTimeout(config.timeout)
}
Expand Down Expand Up @@ -551,7 +551,7 @@ func (l localLinksCache) addRelLinks(localLink string) error {
func toHeaderID(header []byte) string {
var id []byte
// Remove punctuation from header except '-' or '#'.
// '\p{L}\p{N}\p{M}' is the unicode equivalent of '\w', https://www.regular-expressions.info/unicode.html.
// '\p{L}\p{N}\p{M}' is the Unicode equivalent of '\w', https://www.regular-expressions.info/unicode.html.
punctuation := regexp.MustCompile(`[^\p{L}\p{N}\p{M}-# ]`)
header = punctuation.ReplaceAll(header, []byte(""))
headerText := bytes.TrimLeft(bytes.ToLower(header), "#")
Expand Down
4 changes: 2 additions & 2 deletions pkg/mdformatter/linktransformer/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type Validator interface {
IsValid(k futureKey, r *validator) (bool, error)
}

// GitHubPullsIssuesValidator.IsValid skips visiting all github issue/PR links.
// GitHubPullsIssuesValidator.IsValid skips visiting all GitHub issue/PR links.
func (v GitHubPullsIssuesValidator) IsValid(k futureKey, r *validator) (bool, error) {
r.l.githubSkippedLinks.Inc()
// Find rightmost index of match i.e, where regex match ends.
Expand All @@ -31,7 +31,7 @@ func (v GitHubPullsIssuesValidator) IsValid(k futureKey, r *validator) (bool, er
return false, nil
}

// RoundTripValidator.IsValid returns true if url is checked by colly or it is a valid local link.
// RoundTripValidator.IsValid returns true if URL is checked by colly or it is a valid local link.
func (v RoundTripValidator) IsValid(k futureKey, r *validator) (bool, error) {
matches := remoteLinkPrefixRe.FindAllStringIndex(k.dest, 1)
if matches == nil && r.validateConfig.ExplicitLocalValidators {
Expand Down
4 changes: 2 additions & 2 deletions pkg/mdformatter/mdgen/mdgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ func (t *genCodeBlockTransformer) TransformCodeBlock(ctx mdformatter.SourceConte
return code, nil
}

infoFiels, err := shellwords.NewParser().Parse(string(infoString))
infoFields, err := shellwords.NewParser().Parse(string(infoString))
if err != nil {
return nil, fmt.Errorf("parsing info string %v: %w", string(infoString), err)
}
infoStringAttr := map[string]string{}
for i, field := range infoFiels {
for i, field := range infoFields {
val := []string{field}
if i := strings.Index(field, "="); i != -1 {
val = []string{field[:i], field[i+1:]}
Expand Down
2 changes: 1 addition & 1 deletion scripts/build-check-comments.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ set -eu
#
# Checks Go code comments if they have trailing period (excludes protobuffers and vendor files).
# Comments with more than 3 spaces at beginning are omitted from the check, example: '// - foo'.
# This does not include top-level commments for funcs and types.
# This does not include top-level comments for funcs and types.
#
# Example:
# func main() {
Expand Down

0 comments on commit e76ff39

Please sign in to comment.