|
382 | 382 | "source": [ |
383 | 383 | "#|hide\n", |
384 | 384 | "#|export\n", |
385 | | - "class SidebarYmlRemoved:\n", |
| 385 | + "class _SidebarYmlRemoved:\n", |
| 386 | + " \"Context manager for `nbdev_readme` to avoid rendering whole docs website\"\n", |
386 | 387 | " def __init__(self,path): self._path=path\n", |
387 | 388 | " def __enter__(self):\n", |
388 | 389 | " self._yml_path = self._path/'sidebar.yml'\n", |
|
444 | 445 | " path = Path(path) if path else cfg.nbs_path\n", |
445 | 446 | " if chk_time and _readme_not_out_of_date(cfg.config_path/'README.md', path/cfg.readme_nb): return\n", |
446 | 447 | "\n", |
447 | | - " with SidebarYmlRemoved(path): # to avoid rendering whole website\n", |
| 448 | + " with _SidebarYmlRemoved(path): # to avoid rendering whole website\n", |
448 | 449 | " cache = proc_nbs(path)\n", |
449 | 450 | " _sprun(f'cd \"{cache}\" && quarto render \"{cache/cfg.readme_nb}\" -o README.md -t gfm --no-execute')\n", |
450 | 451 | " \n", |
|
459 | 460 | "`nbdev_readme` calls \"quarto render,\" which is explained in the Quarto guide [here](https://quarto.org/docs/projects/code-execution.html)." |
460 | 461 | ] |
461 | 462 | }, |
462 | | - { |
463 | | - "cell_type": "code", |
464 | | - "execution_count": null, |
465 | | - "id": "fe22d431", |
466 | | - "metadata": {}, |
467 | | - "outputs": [ |
468 | | - { |
469 | | - "name": "stdout", |
470 | | - "output_type": "stream", |
471 | | - "text": [ |
472 | | - "\r\n", |
473 | | - " Usage: quarto render [input] [args...]\r\n", |
474 | | - " Version: 1.2.269 \r\n", |
475 | | - "\r\n", |
476 | | - " Description:\r\n", |
477 | | - "\r\n", |
478 | | - " Render files or projects to various document types.\r\n", |
479 | | - "\r\n", |
480 | | - " Options:\r\n", |
481 | | - "\r\n", |
482 | | - " -h, --help - Show this help. \r\n", |
483 | | - " -t, --to - Specify output format(s). \r\n", |
484 | | - " -o, --output - Write output to FILE (use '--output -' for stdout). \r\n", |
485 | | - " --output-dir - Write project output to DIR (path is project relative) \r\n", |
486 | | - " -M, --metadata - Metadata value (KEY:VALUE). \r\n", |
487 | | - " --site-url - Override site-url for website or book output \r\n", |
488 | | - " --execute - Execute code (--no-execute to skip execution). \r\n", |
489 | | - " -P, --execute-param - Execution parameter (KEY:VALUE). \r\n", |
490 | | - " --execute-params - YAML file with execution parameters. \r\n", |
491 | | - " --execute-dir - Working directory for code execution. \r\n", |
492 | | - " --execute-daemon - Keep Jupyter kernel alive (defaults to 300 seconds). \r\n", |
493 | | - " --execute-daemon-restart - Restart keepalive Jupyter kernel before render. \r\n", |
494 | | - " --execute-debug - Show debug output for Jupyter kernel. \r\n", |
495 | | - " --use-freezer - Force use of frozen computations for an incremental file render. \r\n", |
496 | | - " --cache - Cache execution output (--no-cache to prevent cache). \r\n", |
497 | | - " --cache-refresh - Force refresh of execution cache. \r\n", |
498 | | - " --no-clean - Do not clean project output-dir prior to render \r\n", |
499 | | - " --debug - Leave intermediate files in place after render. \r\n", |
500 | | - " pandoc-args... - Additional pandoc command line arguments. \r\n", |
501 | | - " --log <level> - Path to log file \r\n", |
502 | | - " --log-level <level> - Log level (info, warning, error, critical) \r\n", |
503 | | - " --log-format <format> - Log format (plain, json-stream) \r\n", |
504 | | - " --quiet - Suppress console output. \r\n", |
505 | | - " --profile - Active project profile(s) \r\n", |
506 | | - "\r\n", |
507 | | - " Commands:\r\n", |
508 | | - "\r\n", |
509 | | - " help [command] - Show this help or the help of a sub-command.\r\n", |
510 | | - "\r\n", |
511 | | - " Examples:\r\n", |
512 | | - "\r\n", |
513 | | - " Render Markdown: quarto render document.qmd \r\n", |
514 | | - " quarto render document.qmd --to html \r\n", |
515 | | - " quarto render document.qmd --to pdf --toc \r\n", |
516 | | - " Render Notebook: quarto render notebook.ipynb \r\n", |
517 | | - " quarto render notebook.ipynb --to docx \r\n", |
518 | | - " quarto render notebook.ipynb --to pdf --toc \r\n", |
519 | | - " Render Project: quarto render \r\n", |
520 | | - " quarto render projdir \r\n", |
521 | | - " Render w/ Metadata: quarto render document.qmd -M echo:false \r\n", |
522 | | - " quarto render document.qmd -M code-fold:true\r\n", |
523 | | - " Render to Stdout: quarto render document.qmd --output - \r\n", |
524 | | - "\r\n" |
525 | | - ] |
526 | | - } |
527 | | - ], |
528 | | - "source": [ |
529 | | - "!quarto render --help" |
530 | | - ] |
531 | | - }, |
532 | 463 | { |
533 | 464 | "cell_type": "code", |
534 | 465 | "execution_count": null, |
535 | 466 | "id": "f1e1cf1b", |
536 | 467 | "metadata": {}, |
537 | | - "outputs": [ |
538 | | - { |
539 | | - "name": "stderr", |
540 | | - "output_type": "stream", |
541 | | - "text": [ |
542 | | - "\u001b[1mpandoc -o README.md\u001b[22m\n", |
543 | | - " to: >-\n", |
544 | | - " commonmark+autolink_bare_uris+emoji+footnotes+gfm_auto_identifiers+pipe_tables+strikeout+task_lists+tex_math_dollars\n", |
545 | | - " output-file: getting_started.html\n", |
546 | | - " standalone: true\n", |
547 | | - " default-image-extension: png\n", |
548 | | - " \n", |
549 | | - "\u001b[1mmetadata\u001b[22m\n", |
550 | | - " description: Create delightful software with Jupyter Notebooks\n", |
551 | | - " title: Getting Started\n", |
552 | | - " \n", |
553 | | - "Output created: _docs/README.md\n", |
554 | | - "\n" |
555 | | - ] |
556 | | - } |
557 | | - ], |
| 468 | + "outputs": [], |
558 | 469 | "source": [ |
559 | 470 | "#|hide\n", |
560 | 471 | "# nbdev_readme.__wrapped__(chk_time=False)" |
|
0 commit comments