### Automate Documentation Updates with GitHub Actions (YAML) Source: https://context7.com/context7/next_angular_dev_api/llms.txt Example GitHub Actions workflow to automate the process of updating the Angular API documentation. It is scheduled to run weekly and can be triggered manually, using Site2MD to scrape new content, commit changes, and push them back to the repository. ```yaml # Example GitHub Actions workflow (.github/workflows/update-docs.yml) name: Update Angular API Docs on: schedule: - cron: '0 0 * * 0' # Weekly workflow_dispatch: jobs: scrape: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Run Site2MD run: | npx site2md scrape https://next.angular.dev/api \ --output . --recursive - name: Commit changes run: | git config user.name "Bot" git config user.email "bot@example.com" git add . git diff --staged --quiet || \ git commit -m "docs: update $(date +%Y-%m-%d)" git push ``` -------------------------------- ### Load Angular API Docs in Node.js (JavaScript) Source: https://context7.com/context7/next_angular_dev_api/llms.txt Example of reading and parsing markdown documentation files within a Node.js application. It uses asynchronous file system operations to load content and a simple split method to identify sections, demonstrating programmatic access to the scraped docs. ```javascript // Example: Reading documentation in a Node.js application import { readFile } from 'fs/promises'; import { join } from 'path'; async function loadAngularApiDocs(apiPath) { try { const docPath = join(process.cwd(), 'next_angular_dev_api', apiPath); const content = await readFile(docPath, 'utf-8'); // Parse markdown content const sections = content.split('\n# ').filter(s => s.trim()); return { path: apiPath, content: content, sections: sections.length, lastModified: new Date() }; } catch (error) { console.error(`Failed to load docs: ${error.message}`); return null; } } // Usage const formsSignalsDocs = await loadAngularApiDocs('forms/signals.md'); console.log(`Loaded ${formsSignalsDocs.sections} sections from Angular Forms Signals API`); ``` -------------------------------- ### Access and Search Angular Forms Signals Docs (Bash) Source: https://context7.com/context7/next_angular_dev_api/llms.txt Demonstrates basic command-line operations for interacting with the scraped Angular documentation. This includes cloning the repository, reading specific markdown files, searching for API references using grep, and tracking changes with Git. ```bash # Clone the repository git clone https://github.com/context7/next_angular_dev_api.git cd next_angular_dev_api # Read documentation files cat forms/signals.md # Search for specific API references grep -r "FormControl" . # Track documentation changes over time git log --follow forms/signals.md git diff HEAD~1 forms/signals.md ``` -------------------------------- ### Scrape Angular API Docs with Site2MD CLI Source: https://context7.com/context7/next_angular_dev_api/llms.txt Command to initiate the scraping of Angular API documentation using the Site2MD CLI tool. It specifies the target URL, output directory, and recursive behavior for capturing all documentation pages in markdown format. ```bash # Example of how this repository might be generated/updated # (Assuming Site2MD CLI tool usage) site2md scrape https://next.angular.dev/api \ --output ./next_angular_dev_api \ --recursive \ --format markdown # Output structure: # next_angular_dev_api/ # ├── README.md # └── forms/ # └── signals.md ``` -------------------------------- ### Manage Git History for API Docs Changes (Bash) Source: https://context7.com/context7/next_angular_dev_api/llms.txt Utilizes Git commands to manage and inspect the version-controlled documentation repository. This includes viewing commit history, examining specific changes, comparing versions, finding when APIs were documented, and branching for specific versions. ```bash # View repository history git log --oneline --all # Check what documentation was added/modified git show f51bb2a # Compare documentation between commits git diff HEAD~5..HEAD # Find when specific API was documented git log -S "FormControl" --source --all # Create a branch for specific Angular version git checkout -b angular-v17-docs ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.