Skip to content

Fix markdown lint errors and add pt_BR language support#3

Merged
edgarberlinck merged 4 commits intomainfrom
copilot/fix-markdown-lint-issues
Jan 19, 2026
Merged

Fix markdown lint errors and add pt_BR language support#3
edgarberlinck merged 4 commits intomainfrom
copilot/fix-markdown-lint-issues

Conversation

Copy link
Copy Markdown

Copilot AI commented Jan 19, 2026

Addresses maintainer feedback on PR gibbok#137 for Brazilian Portuguese translation: fixes MD012/MD022 markdown lint failures and integrates pt_BR into the tooling pipeline.

Markdown Fixes (README-pt_BR.md)

  • Removed 4 instances of double blank lines (lines 1425, 2033, 2836, 3804)
  • Added missing blank line before heading at line 662

Language Integration

tools/i18n.ts

  • Added pt_BR to Language enum, type, and array

tools/make-books.sh

  • Added pt_BR variables (INPUT_PT, OUTPUT_PT, TITLE_PT)
  • Added pandoc, epubcheck, and ebook-convert commands for pt_BR epub/pdf generation
  • Fixed pre-existing bug: line 54 now validates English epub instead of duplicating Chinese validation

Note

Compile errors in pt_BR are pre-existing translation issues (missing <!-- skip --> comments: 26/54 present vs English). Out of scope for this lint fix.

Original prompt

Fix Markdown Lint Issues and Add pt_BR Language Support

Context

This PR is for the Brazilian Portuguese translation of the TypeScript book. The maintainer has requested fixes for markdown linting errors and the addition of pt_BR language support to the tools configuration.

Reference: gibbok#137

Tasks to Complete

1. Fix Markdown Lint Errors in README-pt_BR.md

The GitHub Actions workflow is failing due to MD012/no-multiple-blanks errors. There are 4 locations with multiple consecutive blank lines that need to be fixed:

  • Line 1425: Remove one blank line (Expected: 1 blank line, Actual: 2)
  • Line 2033: Remove one blank line (Expected: 1 blank line, Actual: 2)
  • Line 2836: Remove one blank line (Expected: 1 blank line, Actual: 2)
  • Line 3804: Remove one blank line (Expected: 1 blank line, Actual: 2)

For each location, find the double blank lines and reduce them to a single blank line.

2. Add pt_BR Language Support to Tools Configuration

Following the pattern from PR gibbok#132 (Belarusian translation), add Brazilian Portuguese language support:

File: tools/i18n.ts

Add pt_BR to the Language enum and update the types:

export enum Language {
    en_EN = 'en_EN',
    zh_CN = 'zh_CN',
    it_IT = 'it_IT',
    pt_BR = 'pt_BR',  // ADD THIS LINE
}
export type Languages = [Language.en_EN, Language.zh_CN, Language.it_IT, Language.pt_BR]  // UPDATE THIS

export const languages: Languages = [Language.en_EN, Language.zh_CN, Language.it_IT, Language.pt_BR]  // UPDATE THIS

File: tools/make-books.sh

Add Brazilian Portuguese book generation commands following the existing pattern:

INPUT_PT="README-pt_BR"
OUTPUT_PT="typescript-book-pt_BR"
TITLE_PT="The Concise TypeScript Book"

# In the pandoc generation section, add:
pandoc -o $DIR_DOWNLOADS/$OUTPUT_PT.epub --metadata title="$TITLE_PT" --metadata author="$AUTHOR" -s $INPUT_PT.md

# In the epubcheck validation section, add:
epubcheck $DIR_DOWNLOADS/$OUTPUT_PT.epub

# In the PDF generation section, add:
ebook-convert $DIR_DOWNLOADS/$OUTPUT_PT.epub $DIR_DOWNLOADS/$OUTPUT_PT.pdf --pdf-page-numbers

3. Verify the Changes

After making the changes:

  • Run npm run check in the tools directory to ensure no lint errors
  • Verify that the markdown file passes all checks
  • Ensure the language configuration is properly integrated

Expected Outcome

  • All markdown lint errors should be resolved
  • The GitHub Actions workflow should pass ✅
  • The pt_BR language should be properly configured in the tools setup
  • The translation will be ready for merge into the main repository

Notes

  • Follow the exact same pattern used for other language translations (zh_CN, it_IT)
  • Maintain consistency with the existing codebase structure
  • Do not modify any translation content, only fix formatting and configuration

This pull request was created from Copilot chat.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits January 19, 2026 07:40
- Remove double blank lines at lines 1425, 2033, 2836, 3804
- Add missing blank line before heading at line 662
- Add pt_BR to Language enum in tools/i18n.ts
- Add pt_BR book generation to tools/make-books.sh

Co-authored-by: edgarberlinck <[email protected]>
Line 54 should validate English epub, not Chinese epub (duplicate)

Co-authored-by: edgarberlinck <[email protected]>
Copilot AI changed the title [WIP] Fix Markdown lint issues and add pt_BR language support Fix markdown lint errors and add pt_BR language support Jan 19, 2026
Copilot AI requested a review from edgarberlinck January 19, 2026 07:44
@edgarberlinck edgarberlinck marked this pull request as ready for review January 19, 2026 20:28
@edgarberlinck edgarberlinck merged commit 1241a6b into main Jan 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants