diff --git a/README.md b/README.md index eb0959d..fc83cf4 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,20 @@ - + # IpynbCompile.jl: 一个实用的Jupyter笔记本构建工具 -[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits&logoColor=white)](https://conventionalcommits.org) -[![Static Badge](https://img.shields.io/badge/julia-package?logo=julia&label=1.7%2B)](https://julialang.org/) +![GitHub License](https://img.shields.io/github/license/ARCJ137442/IpynbCompile.jl?style=for-the-badge&color=a270ba) +![Code Size](https://img.shields.io/github/languages/code-size/ARCJ137442/IpynbCompile.jl?style=for-the-badge&color=a270ba) +![Lines of Code](https://www.aschey.tech/tokei/github.com/ARCJ137442/IpynbCompile.jl?style=for-the-badge&color=a270ba) +[![Language](https://img.shields.io/badge/language-Julia%201.7+-purple?style=for-the-badge&color=a270ba)](https://cn.julialang.org/) -[![CI status](https://github.com/ARCJ137442/IpynbCompile.jl/workflows/CI/badge.svg)](https://github.com/ARCJ137442/IpynbCompile.jl/actions/workflows/ci.yml) +开发状态: -该项目使用[语义化版本 2.0.0](https://semver.org/)进行版本号管理。 +[![CI status](https://img.shields.io/github/actions/workflow/status/ARCJ137442/IpynbCompile.jl/ci.yml?style=for-the-badge)](https://github.com/ARCJ137442/IpynbCompile.jl/actions/workflows/ci.yml) + +![Created At](https://img.shields.io/github/created-at/ARCJ137442/IpynbCompile.jl?style=for-the-badge) +![Last Commit](https://img.shields.io/github/last-commit/ARCJ137442/IpynbCompile.jl?style=for-the-badge) + +[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?style=for-the-badge)](https://conventionalcommits.org) +![GitHub commits since latest release](https://img.shields.io/github/commits-since/ARCJ137442/IpynbCompile.jl/latest?style=for-the-badge) ## 主要功能 diff --git a/src/IpynbCompile.ipynb b/src/IpynbCompile.ipynb index 2c4e30b..13de384 100644 --- a/src/IpynbCompile.ipynb +++ b/src/IpynbCompile.ipynb @@ -19,12 +19,20 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits&logoColor=white)](https://conventionalcommits.org)\n", - "[![Static Badge](https://img.shields.io/badge/julia-package?logo=julia&label=1.7%2B)](https://julialang.org/)\n", + "![GitHub License](https://img.shields.io/github/license/ARCJ137442/IpynbCompile.jl?style=for-the-badge&color=a270ba)\n", + "![Code Size](https://img.shields.io/github/languages/code-size/ARCJ137442/IpynbCompile.jl?style=for-the-badge&color=a270ba)\n", + "![Lines of Code](https://www.aschey.tech/tokei/github.com/ARCJ137442/IpynbCompile.jl?style=for-the-badge&color=a270ba)\n", + "[![Language](https://img.shields.io/badge/language-Julia%201.7+-purple?style=for-the-badge&color=a270ba)](https://cn.julialang.org/)\n", "\n", - "[![CI status](https://github.com/ARCJ137442/IpynbCompile.jl/workflows/CI/badge.svg)](https://github.com/ARCJ137442/IpynbCompile.jl/actions/workflows/ci.yml)\n", + "开发状态:\n", "\n", - "该项目使用[语义化版本 2.0.0](https://semver.org/)进行版本号管理。" + "[![CI status](https://img.shields.io/github/actions/workflow/status/ARCJ137442/IpynbCompile.jl/ci.yml?style=for-the-badge)](https://github.com/ARCJ137442/IpynbCompile.jl/actions/workflows/ci.yml)\n", + "\n", + "![Created At](https://img.shields.io/github/created-at/ARCJ137442/IpynbCompile.jl?style=for-the-badge)\n", + "![Last Commit](https://img.shields.io/github/last-commit/ARCJ137442/IpynbCompile.jl?style=for-the-badge)\n", + "\n", + "[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?style=for-the-badge)](https://conventionalcommits.org)\n", + "![GitHub commits since latest release](https://img.shields.io/github/commits-since/ARCJ137442/IpynbCompile.jl/latest?style=for-the-badge)" ] }, { @@ -760,7 +768,7 @@ "\u001b[36m\u001b[1m│ \u001b[22m\u001b[39m metadata =\n", "\u001b[36m\u001b[1m│ \u001b[22m\u001b[39m Dict{String, Any} with 2 entries:\n", "\u001b[36m\u001b[1m│ \u001b[22m\u001b[39m \"language_info\" => Dict{String, Any}(\"file_extension\"=>\".jl\", \"mimetype\"…\n", - "\u001b[36m\u001b[1m└ \u001b[22m\u001b[39m \"kernelspec\" => Dict{String, Any}(\"name\"=>\"julia-1.10\", \"display_name…\n", + "\u001b[36m\u001b[1m└ \u001b[22m\u001b[39m \"kernelspec\" => Dict{String, Any}(\"name\"=>\"julia-1.9\", \"display_name\"…\n", "\u001b[36m\u001b[1m┌ \u001b[22m\u001b[39m\u001b[36m\u001b[1mInfo: \u001b[22m\u001b[39mmetadata[...]\n", "\u001b[36m\u001b[1m│ \u001b[22m\u001b[39m metadata.language_info =\n", "\u001b[36m\u001b[1m│ \u001b[22m\u001b[39m Dict{String, Any} with 4 entries:\n", @@ -770,8 +778,8 @@ "\u001b[36m\u001b[1m│ \u001b[22m\u001b[39m \"version\" => \"1.10.0\"\n", "\u001b[36m\u001b[1m│ \u001b[22m\u001b[39m metadata.kernelspec =\n", "\u001b[36m\u001b[1m│ \u001b[22m\u001b[39m Dict{String, Any} with 3 entries:\n", - "\u001b[36m\u001b[1m│ \u001b[22m\u001b[39m \"name\" => \"julia-1.10\"\n", - "\u001b[36m\u001b[1m│ \u001b[22m\u001b[39m \"display_name\" => \"Julia 1.10.0\"\n", + "\u001b[36m\u001b[1m│ \u001b[22m\u001b[39m \"name\" => \"julia-1.9\"\n", + "\u001b[36m\u001b[1m│ \u001b[22m\u001b[39m \"display_name\" => \"Julia 1.9.1\"\n", "\u001b[36m\u001b[1m└ \u001b[22m\u001b[39m \"language\" => \"julia\"\n" ] } @@ -815,8 +823,8 @@ "output_type": "stream", "text": [ "\u001b[36m\u001b[1m┌ \u001b[22m\u001b[39m\u001b[36m\u001b[1mInfo: \u001b[22m\u001b[39mJSON转译结构化成功!\n", - "\u001b[36m\u001b[1m│ \u001b[22m\u001b[39m notebook_raw_cell = IpynbNotebook{Any}(Any[Dict{String, Any}(\"cell_type\" => \"markdown\", \"source\" => Any[\"# IpynbCompile.jl: 一个实用的Jupyter笔记本构建工具\"], \"metadata\" => Dict{String, Any}()), Dict{String, Any}(\"cell_type\" => \"markdown\", \"source\" => Any[\"\\n\", \"(✨执行其中所有单元格,可自动构建、测试并生成相应`.jl`源码、测试文件与README!)\"], \"metadata\" => Dict{String, Any}()), Dict{String, Any}(\"cell_type\" => \"markdown\", \"source\" => Any[\"[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits&logoColor=white)](https://conventionalcommits.org)\\n\", \"[![Static Badge](https://img.shields.io/badge/julia-package?logo=julia&label=1.7%2B)](https://julialang.org/)\\n\", \"\\n\", \"[![CI status](https://github.com/ARCJ137442/IpynbCompile.jl/workflows/CI/badge.svg)](https://github.com/ARCJ137442/IpynbCompile.jl/actions/workflows/ci.yml)\\n\", \"\\n\", \"该项目使用[语义化版本 2.0.0](https://semver.org/)进行版本号管理。\"], \"metadata\" => Dict{String, Any}()), Dict{String, Any}(\"cell_type\" => \"markdown\", \"source\" => Any[\"## 主要功能\"], \"metadata\" => Dict{String, Any}()), Dict{String, Any}(\"cell_type\" => \"markdown\", \"source\" => Any[\"### 简介\"], \"metadata\" => Dict{String, Any}()), Dict{String, Any}(\"cell_type\" => \"markdown\", \"source\" => Any[\"📍主要功能:为 [***Jupyter***](https://jupyter.org/) 笔记本(`.ipynb`文件)提供一套特定的注释语法,以支持 **编译转换**&**解释执行** 功能,扩展其应用的可能性\\n\", \"\\n\", \"- 📌可【打开】并【解析】Jupyter笔记本:提供基本的「Jupyter笔记本」「Jupyter笔记本元数据」「Jupyter笔记本单元格」数据结构定义\\n\", \" - 笔记本 `IpynbNotebook{单元格类型}`\\n\", \" - 元数据 `IpynbNotebookMetadata`\\n\", \" - 单元格 `IpynbCell`\\n\", \"- 📌可将Jupyter笔记本(`.ipynb`文件)【转换】成可直接执行的 [***Julia***](https://julialang.org/) 代码\\n\", \" - 编译单元格 `compile_cell`\\n\", \" - 编译笔记本 `compile_notebook`\\n\", \" - 方法1:`compile_notebook(笔记本::IpynbNotebook)`\\n\" … \" - `nothing`(若为其它类型)\\n\", \" - 解析笔记本 `parse_notebook`\\n\", \" - 等效于「编译笔记本的**所有单元格**」\\n\", \" - 执行单元格 `eval_cell`\\n\", \" - 等效于「【解析】并【执行】单元格」\\n\", \" - 执行笔记本 `eval_notebook`\\n\", \" - 等效于「【解析】并【执行】笔记本」\\n\", \" - 逐单元格版本:`eval_notebook_by_cell`\\n\", \" - 引入笔记本 `include_notebook`\\n\", \" - 逐单元格版本:`include_notebook_by_cell`\"], \"metadata\" => Dict{String, Any}()), Dict{String, Any}(\"cell_type\" => \"markdown\", \"source\" => Any[\"✨创新点:**使用多样的「特殊注释」机制,让使用者能更灵活、更便捷地编译Jupyter笔记本,并能将其【交互式】优势用于库的编写之中**\"], \"metadata\" => Dict{String, Any}()), Dict{String, Any}(\"cell_type\" => \"markdown\", \"source\" => Any[\"### 重要机制:单元格「特殊注释」\"], \"metadata\" => Dict{String, Any}()), Dict{String, Any}(\"cell_type\" => \"markdown\", \"source\" => Any[\"简介:单元格的主要「特殊注释」及其作用(以`# 单行注释` `#= 块注释 =#`为例)\\n\", \"\\n\", \"- `# %ignore-line` 忽略下一行\\n\", \"- `# %ignore-below` 忽略下面所有行\\n\", \"- `# %ignore-cell` 忽略整个单元格\\n\", \"- `# %ignore-begin` 块忽略开始\\n\", \"- `# %ignore-end` 块忽略结束\\n\", \"- `#= %only-compiled` 仅编译后可用(头)\\n\", \"- `%only-compiled =#` 仅编译后可用(尾)\\n\", \"- `# %include <路径>` 引入指定路径的文件内容,替代一整行注释\"], \"metadata\" => Dict{String, Any}()), Dict{String, Any}(\"cell_type\" => \"markdown\", \"source\" => Any[\"✨**该笔记本自身**,就是一个好的用法参考来源\"], \"metadata\" => Dict{String, Any}()) … Dict{String, Any}(\"cell_type\" => \"markdown\", \"source\" => Any[\"\\n\", \"## 自动构建\"], \"metadata\" => Dict{String, Any}()), Dict{String, Any}(\"cell_type\" => \"markdown\", \"source\" => Any[\"构建过程主要包括:\\n\", \"\\n\", \"- **自举**构建主模块,生成库文件\\n\", \"- 扫描`src`目录下基本所有Jupyter笔记本(`.ipynb`),编译生成`.jl`源码\\n\", \"- 提取该文件开头Markdown笔记,在**项目根目录**下**生成自述文件**(`README.md`)\\n\", \" - 因此`README.md`暂且只有一种语言(常更新的语言)\\n\", \"\\n\", \"\\n\", \"⚠️不应该在编译后的库文件中看到任何代码\"], \"metadata\" => Dict{String, Any}()), Dict{String, Any}(\"cell_type\" => \"markdown\", \"source\" => Any[\"\\n\", \"### 自举生成源码\"], \"metadata\" => Dict{String, Any}()), Dict{String, Any}(\"outputs\" => Any[Dict{String, Any}(\"name\" => \"stdout\", \"output_type\" => \"stream\", \"text\" => Any[\"\\e[93m\\e[1m✅Jupyter笔记本「主模块」自编译成功!\\e[22m\\e[39m\\n\", \"\\e[93m\\e[1m(共写入 58524 个字节)\\e[22m\\e[39m\\n\"])], \"cell_type\" => \"code\", \"source\" => Any[\"# %ignore-cell # * 自举构建主模块\\n\", \"# * 自编译生成`.jl`源码\\n\", \"let OUT_LIB_FILE = \\\"IpynbCompile.jl\\\" # 直接作为库的主文件\\n\", \" # !不能在`runtests.jl`中运行\\n\", \" contains(@__DIR__, \\\"test\\\") && return\\n\", \"\\n\", \" write_bytes = compile_notebook(SELF_PATH, joinpath(ROOT_PATH, \\\"src\\\", OUT_LIB_FILE))\\n\", \" printstyled(\\n\", \" \\\"✅Jupyter笔记本「主模块」自编译成功!\\\\n(共写入 \\$write_bytes 个字节)\\\\n\\\";\\n\", \" color=:light_yellow, bold=true\\n\", \" )\\n\", \"end\"], \"metadata\" => Dict{String, Any}(), \"execution_count\" => 32), Dict{String, Any}(\"cell_type\" => \"markdown\", \"source\" => Any[\"\\n\", \"### 文件夹下其它笔记本的编译\"], \"metadata\" => Dict{String, Any}()), Dict{String, Any}(\"outputs\" => Any[Dict{String, Any}(\"name\" => \"stdout\", \"output_type\" => \"stream\", \"text\" => Any[\"\\e[92m\\e[1mCompiled: .\\\\compiler.ipynb => .\\\\compiler.jl\\e[22m\\e[39m\\n\", \"\\e[92m\\e[1mCompiled: .\\\\inliner.ipynb => .\\\\inliner.jl\\e[22m\\e[39m\\n\"])], \"cell_type\" => \"code\", \"source\" => Any[\"# %ignore-cell\\n\", \"# * 扫描`src`目录,自动构建主模块\\n\", \"# * - 📝Julia 文件夹遍历:`walkdir`迭代器\\n\", \"# * - 🔗参考:参考:https://stackoverflow.com/questions/58258101/how-to-loop-through-a-folder-of-sub-folders-in-julia\\n\", \"PATH_SRC = \\\".\\\"\\n\", \"let root_folder = PATH_SRC\\n\", \"\\n\", \" # !不能在`runtests.jl`中运行\\n\", \" contains(@__DIR__, \\\"test\\\") && return\\n\", \"\\n\" … \" path => new_path # * 测试Pair\\n\", \" # ! 根目录后续会由`path`自行指定\\n\", \" )\\n\", \" # 输出编译结果\\n\", \" printstyled(\\n\", \" \\\"Compiled: \\$path => \\$new_path\\\\n\\\";\\n\", \" color=:light_green, bold=true\\n\", \" )\\n\", \" end\\n\", \"end\"], \"metadata\" => Dict{String, Any}(), \"execution_count\" => 33), Dict{String, Any}(\"cell_type\" => \"markdown\", \"source\" => Any[\"\\n\", \"### 编译生成测试文件`runtests.jl`\"], \"metadata\" => Dict{String, Any}()), Dict{String, Any}(\"outputs\" => Any[Dict{String, Any}(\"name\" => \"stdout\", \"output_type\" => \"stream\", \"text\" => Any[\"\\e[92m\\e[1m✅测试文件编译成功!\\e[22m\\e[39m\\n\", \"\\e[92m\\e[1m(共写入 50803 个字节)\\e[22m\\e[39m\\n\"])], \"cell_type\" => \"code\", \"source\" => Any[\"# %ignore-cell # * 自举构建主模块\\n\", \"if !contains(@__DIR__, \\\"test\\\") # 不能在测试代码中被重复调用\\n\", \" OUT_TEST_JL = joinpath(ROOT_PATH, \\\"test\\\", \\\"runtests.jl\\\") # 直接作为库的主文件\\n\", \" # 直接拼接所有代码单元格\\n\", \" code_tests = join((\\n\", \" join(cell.source)\\n\", \" for cell in notebook.cells\\n\", \" if cell.cell_type == \\\"code\\\"\\n\", \" ), \\\"\\\\n\\\\n\\\")\\n\", \" # 开头使用Test库,并添加测试上下文\\n\" … \" code_tests *= \\\"\\\"\\\"\\n\", \" end\\n\", \" \\\"\\\"\\\" =#\\n\", \" # 最终写入\\n\", \" write_bytes = write(OUT_TEST_JL, code_tests)\\n\", \" printstyled(\\n\", \" \\\"✅测试文件编译成功!\\\\n(共写入 \\$write_bytes 个字节)\\\\n\\\";\\n\", \" color=:light_green, bold=true\\n\", \" )\\n\", \"end\"], \"metadata\" => Dict{String, Any}(), \"execution_count\" => 34), Dict{String, Any}(\"cell_type\" => \"markdown\", \"source\" => Any[\"\\n\", \"### 编译生成自述文件`README.md`(非库功能)\"], \"metadata\" => Dict{String, Any}()), Dict{String, Any}(\"outputs\" => Any[Dict{String, Any}(\"name\" => \"stdout\", \"output_type\" => \"stream\", \"text\" => Any[\"\\n\", \"# IpynbCompile.jl: 一个实用的Jupyter笔记本构建工具\\n\", \"\\n\", \"[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits&logoColor=white)](https://conventionalcommits.org)\\n\", \"[![Static Badge](https://img.shields.io/badge/julia-package?logo=julia&label=1.7%2B)](https://julialang.org/)\\n\", \"\\n\", \"[![CI status](https://github.com/ARCJ137442/IpynbCompile.jl/workflows/CI/badge.svg)](https://github.com/ARCJ137442/IpynbCompile.jl/actions/workflows/ci.yml)\\n\", \"\\n\", \"该项目使用[语义化版本 2.0.0](https://semver.org/)进行版本号管理。\\n\", \"\\n\" … \"# ↑ 上面一行会被替换成数据\\n\", \"```\\n\", \"\\n\", \"📝Julia的「空白符无关性」允许在等号后边大范围附带注释的空白\\n\", \"\\n\", \"## 参考\\n\", \"\\n\", \"- 本Julia库的灵感来源:[Promises.jl/src/notebook.jl](https://github.com/fonsp/Promises.jl/blob/main/src/notebook.jl)\\n\", \" - 源库使用了 [**Pluto.jl**](https://github.com/fonsp/Pluto.jl) 的「笔记本导出」功能\\n\", \"- **Jupyter Notebook** 文件格式(JSON):[🔗nbformat.readthedocs.io](https://nbformat.readthedocs.io/en/latest/format_description.html#notebook-file-format)\\n\"]), Dict{String, Any}(\"output_type\" => \"execute_result\", \"data\" => Dict{String, Any}(\"text/plain\" => Any[\"8870\"]), \"metadata\" => Dict{String, Any}(), \"execution_count\" => 35)], \"cell_type\" => \"code\", \"source\" => Any[\"# %ignore-cell # * 扫描自身Markdown单元格,自动生成`README.md`\\n\", \"\\\"决定「单元格采集结束」的标识\\\" # ! 不包括结束处单元格\\n\", \"FLAG_END = \\\"\\n\", \"\\$README_markdown_TEXT\\\\\\n\", \"\\\"\\\"\\\"\\n\", \"print(README_markdown_TEXT)\\n\", \"\\n\", \"README_FILE = \\\"README.md\\\"\\n\", \"write(joinpath(ROOT_PATH, README_FILE), README_markdown_TEXT)\"], \"metadata\" => Dict{String, Any}(), \"execution_count\" => 35)], IpynbNotebookMetadata(Dict{String, Any}(\"file_extension\" => \".jl\", \"mimetype\" => \"application/julia\", \"name\" => \"julia\", \"version\" => \"1.10.0\"), Dict{String, Any}(\"name\" => \"julia-1.10\", \"display_name\" => \"Julia 1.10.0\", \"language\" => \"julia\")), 4, 2)\n", - "\u001b[36m\u001b[1m└ \u001b[22m\u001b[39m notebook_metadata = IpynbNotebookMetadata(Dict{String, Any}(\"file_extension\" => \".jl\", \"mimetype\" => \"application/julia\", \"name\" => \"julia\", \"version\" => \"1.10.0\"), Dict{String, Any}(\"name\" => \"julia-1.10\", \"display_name\" => \"Julia 1.10.0\", \"language\" => \"julia\"))\n" + "\u001b[36m\u001b[1m│ \u001b[22m\u001b[39m notebook_raw_cell = IpynbNotebook{Any}(Any[Dict{String, Any}(\"cell_type\" => \"markdown\", \"source\" => Any[\"# IpynbCompile.jl: 一个实用的Jupyter笔记本构建工具\"], \"metadata\" => Dict{String, Any}()), Dict{String, Any}(\"cell_type\" => \"markdown\", \"source\" => Any[\"\\n\", \"(✨执行其中所有单元格,可自动构建、测试并生成相应`.jl`源码、测试文件与README!)\"], \"metadata\" => Dict{String, Any}()), Dict{String, Any}(\"cell_type\" => \"markdown\", \"source\" => Any[\"![GitHub License](https://img.shields.io/github/license/ARCJ137442/IpynbCompile.jl?style=for-the-badge&color=a270ba)\\n\", \"![Code Size](https://img.shields.io/github/languages/code-size/ARCJ137442/IpynbCompile.jl?style=for-the-badge&color=a270ba)\\n\", \"![Lines of Code](https://www.aschey.tech/tokei/github.com/ARCJ137442/IpynbCompile.jl?style=for-the-badge&color=a270ba)\\n\", \"[![Language](https://img.shields.io/badge/language-Julia%201.7+-purple?style=for-the-badge&color=a270ba)](https://cn.julialang.org/)\\n\", \"\\n\", \"开发状态:\\n\", \"\\n\", \"[![CI status](https://img.shields.io/github/actions/workflow/status/ARCJ137442/IpynbCompile.jl/ci.yml?style=for-the-badge)](https://github.com/ARCJ137442/IpynbCompile.jl/actions/workflows/ci.yml)\\n\", \"\\n\", \"![Created At](https://img.shields.io/github/created-at/ARCJ137442/IpynbCompile.jl?style=for-the-badge)\\n\", \"![Last Commit](https://img.shields.io/github/last-commit/ARCJ137442/IpynbCompile.jl?style=for-the-badge)\\n\", \"\\n\", \"[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?style=for-the-badge)](https://conventionalcommits.org)\\n\", \"![GitHub commits since latest release](https://img.shields.io/github/commits-since/ARCJ137442/IpynbCompile.jl/latest?style=for-the-badge)\"], \"metadata\" => Dict{String, Any}()), Dict{String, Any}(\"cell_type\" => \"markdown\", \"source\" => Any[\"## 主要功能\"], \"metadata\" => Dict{String, Any}()), Dict{String, Any}(\"cell_type\" => \"markdown\", \"source\" => Any[\"### 简介\"], \"metadata\" => Dict{String, Any}()), Dict{String, Any}(\"cell_type\" => \"markdown\", \"source\" => Any[\"📍主要功能:为 [***Jupyter***](https://jupyter.org/) 笔记本(`.ipynb`文件)提供一套特定的注释语法,以支持 **编译转换**&**解释执行** 功能,扩展其应用的可能性\\n\", \"\\n\", \"- 📌可【打开】并【解析】Jupyter笔记本:提供基本的「Jupyter笔记本」「Jupyter笔记本元数据」「Jupyter笔记本单元格」数据结构定义\\n\", \" - 笔记本 `IpynbNotebook{单元格类型}`\\n\", \" - 元数据 `IpynbNotebookMetadata`\\n\", \" - 单元格 `IpynbCell`\\n\", \"- 📌可将Jupyter笔记本(`.ipynb`文件)【转换】成可直接执行的 [***Julia***](https://julialang.org/) 代码\\n\", \" - 编译单元格 `compile_cell`\\n\", \" - 编译笔记本 `compile_notebook`\\n\", \" - 方法1:`compile_notebook(笔记本::IpynbNotebook)`\\n\" … \" - `nothing`(若为其它类型)\\n\", \" - 解析笔记本 `parse_notebook`\\n\", \" - 等效于「编译笔记本的**所有单元格**」\\n\", \" - 执行单元格 `eval_cell`\\n\", \" - 等效于「【解析】并【执行】单元格」\\n\", \" - 执行笔记本 `eval_notebook`\\n\", \" - 等效于「【解析】并【执行】笔记本」\\n\", \" - 逐单元格版本:`eval_notebook_by_cell`\\n\", \" - 引入笔记本 `include_notebook`\\n\", \" - 逐单元格版本:`include_notebook_by_cell`\"], \"metadata\" => Dict{String, Any}()), Dict{String, Any}(\"cell_type\" => \"markdown\", \"source\" => Any[\"✨创新点:**使用多样的「特殊注释」机制,让使用者能更灵活、更便捷地编译Jupyter笔记本,并能将其【交互式】优势用于库的编写之中**\"], \"metadata\" => Dict{String, Any}()), Dict{String, Any}(\"cell_type\" => \"markdown\", \"source\" => Any[\"### 重要机制:单元格「特殊注释」\"], \"metadata\" => Dict{String, Any}()), Dict{String, Any}(\"cell_type\" => \"markdown\", \"source\" => Any[\"简介:单元格的主要「特殊注释」及其作用(以`# 单行注释` `#= 块注释 =#`为例)\\n\", \"\\n\", \"- `# %ignore-line` 忽略下一行\\n\", \"- `# %ignore-below` 忽略下面所有行\\n\", \"- `# %ignore-cell` 忽略整个单元格\\n\", \"- `# %ignore-begin` 块忽略开始\\n\", \"- `# %ignore-end` 块忽略结束\\n\", \"- `#= %only-compiled` 仅编译后可用(头)\\n\", \"- `%only-compiled =#` 仅编译后可用(尾)\\n\", \"- `# %include <路径>` 引入指定路径的文件内容,替代一整行注释\"], \"metadata\" => Dict{String, Any}()), Dict{String, Any}(\"cell_type\" => \"markdown\", \"source\" => Any[\"✨**该笔记本自身**,就是一个好的用法参考来源\"], \"metadata\" => Dict{String, Any}()) … Dict{String, Any}(\"cell_type\" => \"markdown\", \"source\" => Any[\"\\n\", \"## 自动构建\"], \"metadata\" => Dict{String, Any}()), Dict{String, Any}(\"cell_type\" => \"markdown\", \"source\" => Any[\"构建过程主要包括:\\n\", \"\\n\", \"- **自举**构建主模块,生成库文件\\n\", \"- 扫描`src`目录下基本所有Jupyter笔记本(`.ipynb`),编译生成`.jl`源码\\n\", \"- 提取该文件开头Markdown笔记,在**项目根目录**下**生成自述文件**(`README.md`)\\n\", \" - 因此`README.md`暂且只有一种语言(常更新的语言)\\n\", \"\\n\", \"\\n\", \"⚠️不应该在编译后的库文件中看到任何代码\"], \"metadata\" => Dict{String, Any}()), Dict{String, Any}(\"cell_type\" => \"markdown\", \"source\" => Any[\"\\n\", \"### 自举生成源码\"], \"metadata\" => Dict{String, Any}()), Dict{String, Any}(\"outputs\" => Any[Dict{String, Any}(\"name\" => \"stdout\", \"output_type\" => \"stream\", \"text\" => Any[\"\\e[93m\\e[1m✅Jupyter笔记本「主模块」自编译成功!\\e[22m\\e[39m\\n\", \"\\e[93m\\e[1m(共写入 58552 个字节)\\e[22m\\e[39m\\n\"])], \"cell_type\" => \"code\", \"source\" => Any[\"# %ignore-cell # * 自举构建主模块\\n\", \"# * 自编译生成`.jl`源码\\n\", \"let OUT_LIB_FILE = \\\"IpynbCompile.jl\\\" # 直接作为库的主文件\\n\", \" # !不能在`runtests.jl`中运行\\n\", \" contains(@__DIR__, \\\"test\\\") && return\\n\", \"\\n\", \" write_bytes = compile_notebook(SELF_PATH, joinpath(ROOT_PATH, \\\"src\\\", OUT_LIB_FILE))\\n\", \" printstyled(\\n\", \" \\\"✅Jupyter笔记本「主模块」自编译成功!\\\\n(共写入 \\$write_bytes 个字节)\\\\n\\\";\\n\", \" color=:light_yellow, bold=true\\n\", \" )\\n\", \"end\"], \"metadata\" => Dict{String, Any}(), \"execution_count\" => 32), Dict{String, Any}(\"cell_type\" => \"markdown\", \"source\" => Any[\"\\n\", \"### 文件夹下其它笔记本的编译\"], \"metadata\" => Dict{String, Any}()), Dict{String, Any}(\"outputs\" => Any[Dict{String, Any}(\"name\" => \"stdout\", \"output_type\" => \"stream\", \"text\" => Any[\"\\e[92m\\e[1mCompiled: .\\\\compiler.ipynb => .\\\\compiler.jl\\e[22m\\e[39m\\n\", \"\\e[92m\\e[1mCompiled: .\\\\inliner.ipynb => .\\\\inliner.jl\\e[22m\\e[39m\\n\"])], \"cell_type\" => \"code\", \"source\" => Any[\"# %ignore-cell\\n\", \"# * 扫描`src`目录,自动构建主模块\\n\", \"# * - 📝Julia 文件夹遍历:`walkdir`迭代器\\n\", \"# * - 🔗参考:参考:https://stackoverflow.com/questions/58258101/how-to-loop-through-a-folder-of-sub-folders-in-julia\\n\", \"PATH_SRC = \\\".\\\"\\n\", \"let root_folder = PATH_SRC\\n\", \"\\n\", \" # !不能在`runtests.jl`中运行\\n\", \" contains(@__DIR__, \\\"test\\\") && return\\n\", \"\\n\" … \" path => new_path # * 测试Pair\\n\", \" # ! 根目录后续会由`path`自行指定\\n\", \" )\\n\", \" # 输出编译结果\\n\", \" printstyled(\\n\", \" \\\"Compiled: \\$path => \\$new_path\\\\n\\\";\\n\", \" color=:light_green, bold=true\\n\", \" )\\n\", \" end\\n\", \"end\"], \"metadata\" => Dict{String, Any}(), \"execution_count\" => 33), Dict{String, Any}(\"cell_type\" => \"markdown\", \"source\" => Any[\"\\n\", \"### 编译生成测试文件`runtests.jl`\"], \"metadata\" => Dict{String, Any}()), Dict{String, Any}(\"outputs\" => Any[Dict{String, Any}(\"name\" => \"stdout\", \"output_type\" => \"stream\", \"text\" => Any[\"\\e[92m\\e[1m✅测试文件编译成功!\\e[22m\\e[39m\\n\", \"\\e[92m\\e[1m(共写入 50831 个字节)\\e[22m\\e[39m\\n\"])], \"cell_type\" => \"code\", \"source\" => Any[\"# %ignore-cell # * 自举构建主模块\\n\", \"if !contains(@__DIR__, \\\"test\\\") # 不能在测试代码中被重复调用\\n\", \" OUT_TEST_JL = joinpath(ROOT_PATH, \\\"test\\\", \\\"runtests.jl\\\") # 直接作为库的主文件\\n\", \" # 直接拼接所有代码单元格\\n\", \" code_tests = join((\\n\", \" join(cell.source)\\n\", \" for cell in notebook.cells\\n\", \" if cell.cell_type == \\\"code\\\"\\n\", \" ), \\\"\\\\n\\\\n\\\")\\n\", \" # 开头使用Test库,并添加测试上下文\\n\" … \" code_tests *= \\\"\\\"\\\"\\n\", \" end\\n\", \" \\\"\\\"\\\" =#\\n\", \" # 最终写入\\n\", \" write_bytes = write(OUT_TEST_JL, code_tests)\\n\", \" printstyled(\\n\", \" \\\"✅测试文件编译成功!\\\\n(共写入 \\$write_bytes 个字节)\\\\n\\\";\\n\", \" color=:light_green, bold=true\\n\", \" )\\n\", \"end\"], \"metadata\" => Dict{String, Any}(), \"execution_count\" => 34), Dict{String, Any}(\"cell_type\" => \"markdown\", \"source\" => Any[\"\\n\", \"### 编译生成自述文件`README.md`(非库功能)\"], \"metadata\" => Dict{String, Any}()), Dict{String, Any}(\"outputs\" => Any[Dict{String, Any}(\"name\" => \"stdout\", \"output_type\" => \"stream\", \"text\" => Any[\"\\n\", \"# IpynbCompile.jl: 一个实用的Jupyter笔记本构建工具\\n\", \"\\n\", \"[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits&logoColor=white)](https://conventionalcommits.org)\\n\", \"[![Static Badge](https://img.shields.io/badge/julia-package?logo=julia&label=1.7%2B)](https://julialang.org/)\\n\", \"\\n\", \"[![CI status](https://github.com/ARCJ137442/IpynbCompile.jl/workflows/CI/badge.svg)](https://github.com/ARCJ137442/IpynbCompile.jl/actions/workflows/ci.yml)\\n\", \"\\n\", \"该项目使用[语义化版本 2.0.0](https://semver.org/)进行版本号管理。\\n\", \"\\n\" … \"# ↑ 上面一行会被替换成数据\\n\", \"```\\n\", \"\\n\", \"📝Julia的「空白符无关性」允许在等号后边大范围附带注释的空白\\n\", \"\\n\", \"## 参考\\n\", \"\\n\", \"- 本Julia库的灵感来源:[Promises.jl/src/notebook.jl](https://github.com/fonsp/Promises.jl/blob/main/src/notebook.jl)\\n\", \" - 源库使用了 [**Pluto.jl**](https://github.com/fonsp/Pluto.jl) 的「笔记本导出」功能\\n\", \"- **Jupyter Notebook** 文件格式(JSON):[🔗nbformat.readthedocs.io](https://nbformat.readthedocs.io/en/latest/format_description.html#notebook-file-format)\\n\"]), Dict{String, Any}(\"output_type\" => \"execute_result\", \"data\" => Dict{String, Any}(\"text/plain\" => Any[\"8870\"]), \"metadata\" => Dict{String, Any}(), \"execution_count\" => 35)], \"cell_type\" => \"code\", \"source\" => Any[\"# %ignore-cell # * 扫描自身Markdown单元格,自动生成`README.md`\\n\", \"\\\"决定「单元格采集结束」的标识\\\" # ! 不包括结束处单元格\\n\", \"FLAG_END = \\\"\\n\", \"\\$README_markdown_TEXT\\\\\\n\", \"\\\"\\\"\\\"\\n\", \"print(README_markdown_TEXT)\\n\", \"\\n\", \"README_FILE = \\\"README.md\\\"\\n\", \"write(joinpath(ROOT_PATH, README_FILE), README_markdown_TEXT)\"], \"metadata\" => Dict{String, Any}(), \"execution_count\" => 35)], IpynbNotebookMetadata(Dict{String, Any}(\"file_extension\" => \".jl\", \"mimetype\" => \"application/julia\", \"name\" => \"julia\", \"version\" => \"1.10.0\"), Dict{String, Any}(\"name\" => \"julia-1.9\", \"display_name\" => \"Julia 1.9.1\", \"language\" => \"julia\")), 4, 2)\n", + "\u001b[36m\u001b[1m└ \u001b[22m\u001b[39m notebook_metadata = IpynbNotebookMetadata(Dict{String, Any}(\"file_extension\" => \".jl\", \"mimetype\" => \"application/julia\", \"name\" => \"julia\", \"version\" => \"1.10.0\"), Dict{String, Any}(\"name\" => \"julia-1.9\", \"display_name\" => \"Julia 1.9.1\", \"language\" => \"julia\"))\n" ] } ], @@ -1265,9 +1273,9 @@ "name": "stdout", "output_type": "stream", "text": [ - "# %% Jupyter Notebook | Julia 1.10.0 @ julia | format 2~4\n", + "# %% Jupyter Notebook | Julia 1.9.1 @ julia | format 2~4\n", "# % language_info: {\"file_extension\":\".jl\",\"mimetype\":\"application/julia\",\"name\":\"julia\",\"version\":\"1.10.0\"}\n", - "# % kernelspec: {\"name\":\"julia-1.10\",\"display_name\":\"Julia 1.10.0\",\"language\":\"julia\"}\n", + "# % kernelspec: {\"name\":\"julia-1.9\",\"display_name\":\"Julia 1.9.1\",\"language\":\"julia\"}\n", "# % nbformat: 4\n", "# % nbformat_minor: 2\n" ] @@ -1497,7 +1505,7 @@ "122-element Vector{IpynbCell}:\n", " IpynbCell(\"markdown\", [\"# IpynbCompile.jl: 一个实用的Jupyter笔记本构建工具\"], Dict{String, Any}(), nothing)\n", " IpynbCell(\"markdown\", [\"\\n\", \"(✨执行其中所有单元格,可自动构建、测试并生成相应`.jl`源码、测试文件与README!)\"], Dict{String, Any}(), nothing)\n", - " IpynbCell(\"markdown\", [\"[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits&logoColor=white)](https://conventionalcommits.org)\\n\", \"[![Static Badge](https://img.shields.io/badge/julia-package?logo=julia&label=1.7%2B)](https://julialang.org/)\\n\", \"\\n\", \"[![CI status](https://github.com/ARCJ137442/IpynbCompile.jl/workflows/CI/badge.svg)](https://github.com/ARCJ137442/IpynbCompile.jl/actions/workflows/ci.yml)\\n\", \"\\n\", \"该项目使用[语义化版本 2.0.0](https://semver.org/)进行版本号管理。\"], Dict{String, Any}(), nothing)\n", + " IpynbCell(\"markdown\", [\"![GitHub License](https://img.shields.io/github/license/ARCJ137442/IpynbCompile.jl?style=for-the-badge&color=a270ba)\\n\", \"![Code Size](https://img.shields.io/github/languages/code-size/ARCJ137442/IpynbCompile.jl?style=for-the-badge&color=a270ba)\\n\", \"![Lines of Code](https://www.aschey.tech/tokei/github.com/ARCJ137442/IpynbCompile.jl?style=for-the-badge&color=a270ba)\\n\", \"[![Language](https://img.shields.io/badge/language-Julia%201.7+-purple?style=for-the-badge&color=a270ba)](https://cn.julialang.org/)\\n\", \"\\n\", \"开发状态:\\n\", \"\\n\", \"[![CI status](https://img.shields.io/github/actions/workflow/status/ARCJ137442/IpynbCompile.jl/ci.yml?style=for-the-badge)](https://github.com/ARCJ137442/IpynbCompile.jl/actions/workflows/ci.yml)\\n\", \"\\n\", \"![Created At](https://img.shields.io/github/created-at/ARCJ137442/IpynbCompile.jl?style=for-the-badge)\\n\", \"![Last Commit](https://img.shields.io/github/last-commit/ARCJ137442/IpynbCompile.jl?style=for-the-badge)\\n\", \"\\n\", \"[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?style=for-the-badge)](https://conventionalcommits.org)\\n\", \"![GitHub commits since latest release](https://img.shields.io/github/commits-since/ARCJ137442/IpynbCompile.jl/latest?style=for-the-badge)\"], Dict{String, Any}(), nothing)\n", " IpynbCell(\"markdown\", [\"## 主要功能\"], Dict{String, Any}(), nothing)\n", " IpynbCell(\"markdown\", [\"### 简介\"], Dict{String, Any}(), nothing)\n", " IpynbCell(\"markdown\", [\"📍主要功能:为 [***Jupyter***](https://jupyter.org/) 笔记本(`.ipynb`文件)提供一套特定的注释语法,以支持 **编译转换**&**解释执行** 功能,扩展其应用的可能性\\n\", \"\\n\", \"- 📌可【打开】并【解析】Jupyter笔记本:提供基本的「Jupyter笔记本」「Jupyter笔记本元数据」「Jupyter笔记本单元格」数据结构定义\\n\", \" - 笔记本 `IpynbNotebook{单元格类型}`\\n\", \" - 元数据 `IpynbNotebookMetadata`\\n\", \" - 单元格 `IpynbCell`\\n\", \"- 📌可将Jupyter笔记本(`.ipynb`文件)【转换】成可直接执行的 [***Julia***](https://julialang.org/) 代码\\n\", \" - 编译单元格 `compile_cell`\\n\", \" - 编译笔记本 `compile_notebook`\\n\", \" - 方法1:`compile_notebook(笔记本::IpynbNotebook)`\\n\" … \" - `nothing`(若为其它类型)\\n\", \" - 解析笔记本 `parse_notebook`\\n\", \" - 等效于「编译笔记本的**所有单元格**」\\n\", \" - 执行单元格 `eval_cell`\\n\", \" - 等效于「【解析】并【执行】单元格」\\n\", \" - 执行笔记本 `eval_notebook`\\n\", \" - 等效于「【解析】并【执行】笔记本」\\n\", \" - 逐单元格版本:`eval_notebook_by_cell`\\n\", \" - 引入笔记本 `include_notebook`\\n\", \" - 逐单元格版本:`include_notebook_by_cell`\"], Dict{String, Any}(), nothing)\n", @@ -3205,7 +3213,7 @@ "data": { "text/plain": [ "35-element Vector{Expr}:\n", - " :($(Expr(:toplevel, :(\u001b[90m#= none:10 =#\u001b[39m), :($(Expr(:incomplete, Base.Meta.ParseError(\"ParseError:\\n# Error @ none:10:2\\nmodule IpynbCompile # 后续编译后会变为模块上下文\\n\\n#└ ── premature end of input\", Base.JuliaSyntax.ParseError(Base.JuliaSyntax.SourceFile(\"# %% [1] code\\n# ! ↓这后边注释的代码只有在编译后才会被执行\\n# ! 使用多行注释/块注释的语法,\\n# ! 以`#= %only-compiled`行*开头*\\n# ! 以`%only-compiled =#`行*结尾*\\n\\\"\\\"\\\"\\nIpynbCompile 主模块\\n\\\"\\\"\\\"\\nmodule IpynbCompile # 后续编译后会变为模块上下文\\n\\n\", 0, \"none\", 1, [1, 15, 80, 125, 167, 209, 213, 236, 240, 302, 303]), Base.JuliaSyntax.Diagnostic[Base.JuliaSyntax.Diagnostic(303, 302, :error, \"premature end of input\"), Base.JuliaSyntax.Diagnostic(303, 302, :error, \"Expected `end`\")], :block))))))))\n", + " :($(Expr(:toplevel, :(\u001b[90m#= none:6 =#\u001b[39m), :($(Expr(:incomplete, \"incomplete: premature end of input\"))))))\n", " :($(Expr(:toplevel, :(\u001b[90m#= none:2 =#\u001b[39m), :(import JSON))))\n", " :($(Expr(:toplevel, :(\u001b[90m#= none:2 =#\u001b[39m), :(\u001b[90m#= none:2 =#\u001b[39m Core.@doc \"JSON常用的字典\" const JSONDict{ValueType} = (Dict{String, ValueType} where ValueType)), :(\u001b[90m#= none:5 =#\u001b[39m), :(\u001b[90m#= none:5 =#\u001b[39m Core.@doc \"默认解析出来的JSON字典(与`JSONDict`有本质不同,会影响到后续方法分派,并可能导致歧义)\" const JSONDictAny = JSONDict{Any}))))\n", " :($(Expr(:toplevel, :(\u001b[90m#= none:2 =#\u001b[39m), :(import Base: @kwdef))))\n", @@ -3216,7 +3224,7 @@ " read(f, String) |> JSON.parse\n", " end\n", " end))))\n", - " :($(Expr(:toplevel, :(\u001b[90m#= none:1 =#\u001b[39m))))\n", + " :($(Expr(:toplevel)))\n", " :($(Expr(:toplevel, :(\u001b[90m#= none:2 =#\u001b[39m), :(export IpynbNotebook, IpynbNotebookMetadata), :(\u001b[90m#= none:4 =#\u001b[39m), :(\u001b[90m#= none:4 =#\u001b[39m Core.@doc \"定义一个Jupyter Notebook的metadata结构\\n- 🎯规范化存储Jupyter Notebook的元数据\\n - 根据官方文档,仅存储【已经确定存在】的「语言信息」和「内核信息」\\n\" \u001b[90m#= none:9 =#\u001b[39m @kwdef(struct IpynbNotebookMetadata\n", " \u001b[90m#= none:10 =#\u001b[39m\n", " \"语言信息\"\n", @@ -3297,11 +3305,11 @@ " \u001b[90m#= none:70 =#\u001b[39m\n", " get(LANG_EXTENSION_DICT, lang, string(lang))\n", " end))))\n", - " :($(Expr(:toplevel, :(\u001b[90m#= none:1 =#\u001b[39m))))\n", + " :($(Expr(:toplevel)))\n", " ⋮\n", - " :($(Expr(:toplevel, :(\u001b[90m#= none:1 =#\u001b[39m))))\n", + " :($(Expr(:toplevel)))\n", " :($(Expr(:toplevel, :(\u001b[90m#= none:2 =#\u001b[39m), :(export compile_notebook), :(\u001b[90m#= none:4 =#\u001b[39m), :(\u001b[90m#= none:4 =#\u001b[39m Core.@doc \"编译整个笔记本\\n- 🎯编译整个笔记本对象,形成相应Julia代码\\n- 📌整体文本:头部注释+各单元格编译(逐个join(_, '\\\\n'))\\n- ⚠️末尾不会附加换行符\\n- @param notebook 要编译的笔记本对象\\n- @return 编译后的文本\\n\" compile_notebook(notebook::IpynbNotebook; lang = identify_lang(notebook), kwargs...) = begin\n", - " \u001b[90m#= none:12 =#\u001b[39m\n", + " \u001b[90m#= none:17 =#\u001b[39m\n", " \"$(compile_notebook_head(notebook; lang, kwargs...))\\n$(compile_cell(notebook.cells; lang, kwargs...))\\n\"\n", " end), :(\u001b[90m#= none:22 =#\u001b[39m), :(\u001b[90m#= none:22 =#\u001b[39m Core.@doc \"以「配对」方式进行展开,允许同时编译多个笔记本\\n- 🎯支持形如`compile_notebook(笔记本1 => 目标1, 笔记本2 => 目标2)`的语法\\n- 📌无论在此的「笔记本」「目标」路径还是其它的\\n- @param pairs 笔记本与目标的「配对」\\n\" function compile_notebook(pairs::Vararg{Pair})\n", " \u001b[90m#= none:28 =#\u001b[39m\n", @@ -3433,12 +3441,12 @@ " \u001b[90m#= none:151 =#\u001b[39m\n", " inline_notebook_to_markdown(IpynbNotebook(path), \"$(path).md\"; root_path = dirname(path))\n", " end))))\n", - " :($(Expr(:toplevel, :(\u001b[90m#= none:1 =#\u001b[39m))))\n", - " :($(Expr(:toplevel, :(\u001b[90m#= none:4 =#\u001b[39m), :($(Expr(:error, Base.Meta.ParseError(\"ParseError:\\n# Error @ none:4:1\\n# ! 仍然使用多行注释语法,以便统一格式\\nend # module\\n└─┘ ── invalid identifier\", Base.JuliaSyntax.ParseError(Base.JuliaSyntax.SourceFile(\"# %% [31] code\\n# ! ↓这后边注释的代码只有在编译后才会被执行\\n# ! 仍然使用多行注释语法,以便统一格式\\nend # module\\n\\n\", 0, \"none\", 1, [1, 16, 81, 137, 150, 151]), Base.JuliaSyntax.Diagnostic[Base.JuliaSyntax.Diagnostic(137, 139, :error, \"invalid identifier\")], :none))))))))\n", - " :($(Expr(:toplevel, :(\u001b[90m#= none:1 =#\u001b[39m))))\n", - " :($(Expr(:toplevel, :(\u001b[90m#= none:1 =#\u001b[39m))))\n", - " :($(Expr(:toplevel, :(\u001b[90m#= none:1 =#\u001b[39m))))\n", - " :($(Expr(:toplevel, :(\u001b[90m#= none:1 =#\u001b[39m))))" + " :($(Expr(:toplevel)))\n", + " :($(Expr(:toplevel, :(\u001b[90m#= none:4 =#\u001b[39m), :($(Expr(:error, \"unexpected \\\"end\\\"\"))))))\n", + " :($(Expr(:toplevel)))\n", + " :($(Expr(:toplevel)))\n", + " :($(Expr(:toplevel)))\n", + " :($(Expr(:toplevel)))" ] }, "execution_count": 23, @@ -3552,52 +3560,54 @@ "Stacktrace:\n", " [1] \u001b[0m\u001b[1mcompile_code_lines\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90mcell\u001b[39m::\u001b[0mIpynbCell\u001b[0m\u001b[1m)\u001b[22m\n", "\u001b[90m @\u001b[39m \u001b[35mMain\u001b[39m \u001b[90m.\\\u001b[39m\u001b[90m\u001b[4mIn[21]:39\u001b[24m\u001b[39m\n", - " [2] \u001b[0m\u001b[1mcompile_cell\u001b[22m\u001b[0m\u001b[1m(\u001b[22m::\u001b[0mVal\u001b[90m{:code}\u001b[39m, \u001b[90mcell\u001b[39m::\u001b[0mIpynbCell; \u001b[90mkwargs\u001b[39m::\u001b[0m@Kwargs\u001b[90m{}\u001b[39m\u001b[0m\u001b[1m)\u001b[22m\n", + " [2] \u001b[0m\u001b[1mcompile_cell\u001b[22m\u001b[0m\u001b[1m(\u001b[22m::\u001b[0mVal\u001b[90m{:code}\u001b[39m, \u001b[90mcell\u001b[39m::\u001b[0mIpynbCell; \u001b[90mkwargs\u001b[39m::\u001b[0mBase.Pairs\u001b[90m{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}\u001b[39m\u001b[0m\u001b[1m)\u001b[22m\n", "\u001b[90m @\u001b[39m \u001b[35mMain\u001b[39m \u001b[90m.\\\u001b[39m\u001b[90m\u001b[4mIn[21]:20\u001b[24m\u001b[39m\n", " [3] \u001b[0m\u001b[1mcompile_cell\u001b[22m\u001b[0m\u001b[1m(\u001b[22m::\u001b[0mVal\u001b[90m{:code}\u001b[39m, \u001b[90mcell\u001b[39m::\u001b[0mIpynbCell\u001b[0m\u001b[1m)\u001b[22m\n", "\u001b[90m @\u001b[39m \u001b[35mMain\u001b[39m \u001b[90m.\\\u001b[39m\u001b[90m\u001b[4mIn[21]:19\u001b[24m\u001b[39m\n", - " [4] \u001b[0m\u001b[1mcompile_cell\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90mcell\u001b[39m::\u001b[0mIpynbCell; \u001b[90mkwargs\u001b[39m::\u001b[0m@Kwargs\u001b[90m{}\u001b[39m\u001b[0m\u001b[1m)\u001b[22m\n", + " [4] \u001b[0m\u001b[1mcompile_cell\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90mcell\u001b[39m::\u001b[0mIpynbCell; \u001b[90mkwargs\u001b[39m::\u001b[0mBase.Pairs\u001b[90m{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}\u001b[39m\u001b[0m\u001b[1m)\u001b[22m\n", + "\u001b[90m @\u001b[39m \u001b[35mMain\u001b[39m \u001b[90m.\\\u001b[39m\u001b[90m\u001b[4mIn[18]:11\u001b[24m\u001b[39m\n", + " [5] \u001b[0m\u001b[1mcompile_cell\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90mcell\u001b[39m::\u001b[0mIpynbCell\u001b[0m\u001b[1m)\u001b[22m\n", "\u001b[90m @\u001b[39m \u001b[35mMain\u001b[39m \u001b[90m.\\\u001b[39m\u001b[90m\u001b[4mIn[18]:11\u001b[24m\u001b[39m\n", - " [5] \u001b[0m\u001b[1m(::var\"#32#34\"{@Kwargs{}})\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90mcell\u001b[39m::\u001b[0mIpynbCell\u001b[0m\u001b[1m)\u001b[22m\n", + " [6] \u001b[0m\u001b[1m(::var\"#34#36\"{Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}})\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90mcell\u001b[39m::\u001b[0mIpynbCell\u001b[0m\u001b[1m)\u001b[22m\n", "\u001b[90m @\u001b[39m \u001b[35mMain\u001b[39m \u001b[90m.\\\u001b[39m\u001b[90m\u001b[4mnone:0\u001b[24m\u001b[39m\n", - " [6] \u001b[0m\u001b[1miterate\u001b[22m\n", - "\u001b[90m @\u001b[39m \u001b[90mBase\u001b[39m \u001b[90m.\\\u001b[39m\u001b[90m\u001b[4mgenerator.jl:47\u001b[24m\u001b[39m\u001b[90m [inlined]\u001b[39m\n", - " [7] \u001b[0m\u001b[1mjoin\u001b[22m\n", - "\u001b[90m @\u001b[39m \u001b[90m.\\strings\\\u001b[39m\u001b[90m\u001b[4mio.jl:350\u001b[24m\u001b[39m\u001b[90m [inlined]\u001b[39m\n", - " [8] \u001b[0m\u001b[1mjoin\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90mio\u001b[39m::\u001b[0mIOBuffer, \u001b[90miterator\u001b[39m::\u001b[0mBase.Generator\u001b[90m{Base.Iterators.Filter{var\"#33#35\", Vector{IpynbCell}}, var\"#32#34\"{@Kwargs{}}}\u001b[39m\u001b[0m\u001b[1m)\u001b[22m\n", - "\u001b[90m @\u001b[39m \u001b[90mBase\u001b[39m \u001b[90m.\\strings\\\u001b[39m\u001b[90m\u001b[4mio.jl:349\u001b[24m\u001b[39m\n", - " [9] \u001b[0m\u001b[1msprint\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90mf\u001b[39m::\u001b[0mFunction, \u001b[90margs\u001b[39m::\u001b[0mBase.Generator\u001b[90m{Base.Iterators.Filter{var\"#33#35\", Vector{IpynbCell}}, var\"#32#34\"{@Kwargs{}}}\u001b[39m; \u001b[90mcontext\u001b[39m::\u001b[0mNothing, \u001b[90msizehint\u001b[39m::\u001b[0mInt64\u001b[0m\u001b[1m)\u001b[22m\n", + " [7] \u001b[0m\u001b[1miterate\u001b[22m\n", + "\u001b[90m @\u001b[39m \u001b[90m.\\\u001b[39m\u001b[90m\u001b[4mgenerator.jl:47\u001b[24m\u001b[39m\u001b[90m [inlined]\u001b[39m\n", + " [8] \u001b[0m\u001b[1mjoin\u001b[22m\n", + "\u001b[90m @\u001b[39m \u001b[90m.\\strings\\\u001b[39m\u001b[90m\u001b[4mio.jl:346\u001b[24m\u001b[39m\u001b[90m [inlined]\u001b[39m\n", + " [9] \u001b[0m\u001b[1mjoin\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90mio\u001b[39m::\u001b[0mIOBuffer, \u001b[90miterator\u001b[39m::\u001b[0mBase.Generator\u001b[90m{Base.Iterators.Filter{var\"#35#37\", Vector{IpynbCell}}, var\"#34#36\"{Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}}\u001b[39m\u001b[0m\u001b[1m)\u001b[22m\n", + "\u001b[90m @\u001b[39m \u001b[90mBase\u001b[39m \u001b[90m.\\strings\\\u001b[39m\u001b[90m\u001b[4mio.jl:345\u001b[24m\u001b[39m\n", + " [10] \u001b[0m\u001b[1msprint\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90mf\u001b[39m::\u001b[0mFunction, \u001b[90margs\u001b[39m::\u001b[0mBase.Generator\u001b[90m{Base.Iterators.Filter{var\"#35#37\", Vector{IpynbCell}}, var\"#34#36\"{Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}}\u001b[39m; \u001b[90mcontext\u001b[39m::\u001b[0mNothing, \u001b[90msizehint\u001b[39m::\u001b[0mInt64\u001b[0m\u001b[1m)\u001b[22m\n", "\u001b[90m @\u001b[39m \u001b[90mBase\u001b[39m \u001b[90m.\\strings\\\u001b[39m\u001b[90m\u001b[4mio.jl:114\u001b[24m\u001b[39m\n", - " [10] \u001b[0m\u001b[1msprint\u001b[22m\n", + " [11] \u001b[0m\u001b[1msprint\u001b[22m\n", "\u001b[90m @\u001b[39m \u001b[90m.\\strings\\\u001b[39m\u001b[90m\u001b[4mio.jl:107\u001b[24m\u001b[39m\u001b[90m [inlined]\u001b[39m\n", - " [11] \u001b[0m\u001b[1mjoin\u001b[22m\n", - "\u001b[90m @\u001b[39m \u001b[90m.\\strings\\\u001b[39m\u001b[90m\u001b[4mio.jl:356\u001b[24m\u001b[39m\u001b[90m [inlined]\u001b[39m\n", - " [12] \u001b[0m\u001b[1m#parse_cell#31\u001b[22m\n", + " [12] \u001b[0m\u001b[1mjoin\u001b[22m\n", + "\u001b[90m @\u001b[39m \u001b[90m.\\strings\\\u001b[39m\u001b[90m\u001b[4mio.jl:352\u001b[24m\u001b[39m\u001b[90m [inlined]\u001b[39m\n", + " [13] \u001b[0m\u001b[1m#parse_cell#33\u001b[22m\n", "\u001b[90m @\u001b[39m \u001b[90m.\\\u001b[39m\u001b[90m\u001b[4mIn[23]:35\u001b[24m\u001b[39m\u001b[90m [inlined]\u001b[39m\n", - " [13] \u001b[0m\u001b[1mparse_cell\u001b[22m\n", + " [14] \u001b[0m\u001b[1mparse_cell\u001b[22m\n", "\u001b[90m @\u001b[39m \u001b[90m.\\\u001b[39m\u001b[90m\u001b[4mIn[23]:34\u001b[24m\u001b[39m\u001b[90m [inlined]\u001b[39m\n", - " [14] \u001b[0m\u001b[1mtryparse_cell\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90margs\u001b[39m::\u001b[0mVector\u001b[90m{IpynbCell}\u001b[39m; \u001b[90mkwargs\u001b[39m::\u001b[0m@Kwargs\u001b[90m{}\u001b[39m\u001b[0m\u001b[1m)\u001b[22m\n", + " [15] \u001b[0m\u001b[1mtryparse_cell\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90margs\u001b[39m::\u001b[0mVector\u001b[90m{IpynbCell}\u001b[39m; \u001b[90mkwargs\u001b[39m::\u001b[0mBase.Pairs\u001b[90m{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}\u001b[39m\u001b[0m\u001b[1m)\u001b[22m\n", "\u001b[90m @\u001b[39m \u001b[35mMain\u001b[39m \u001b[90m.\\\u001b[39m\u001b[90m\u001b[4mIn[23]:55\u001b[24m\u001b[39m\n", - " [15] \u001b[0m\u001b[1mtryparse_cell\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90margs\u001b[39m::\u001b[0mVector\u001b[90m{IpynbCell}\u001b[39m\u001b[0m\u001b[1m)\u001b[22m\n", + " [16] \u001b[0m\u001b[1mtryparse_cell\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90margs\u001b[39m::\u001b[0mVector\u001b[90m{IpynbCell}\u001b[39m\u001b[0m\u001b[1m)\u001b[22m\n", "\u001b[90m @\u001b[39m \u001b[35mMain\u001b[39m \u001b[90m.\\\u001b[39m\u001b[90m\u001b[4mIn[23]:53\u001b[24m\u001b[39m\n", - " [16] top-level scope\n", + " [17] top-level scope\n", "\u001b[90m @\u001b[39m \u001b[90m\u001b[4mIn[24]:2\u001b[24m\u001b[39m\n", - " [17] \u001b[0m\u001b[1meval\u001b[22m\n", - "\u001b[90m @\u001b[39m \u001b[90m.\\\u001b[39m\u001b[90m\u001b[4mboot.jl:385\u001b[24m\u001b[39m\u001b[90m [inlined]\u001b[39m\n", - " [18] \u001b[0m\u001b[1minclude_string\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90mmapexpr\u001b[39m::\u001b[0mtypeof(REPL.softscope), \u001b[90mmod\u001b[39m::\u001b[0mModule, \u001b[90mcode\u001b[39m::\u001b[0mString, \u001b[90mfilename\u001b[39m::\u001b[0mString\u001b[0m\u001b[1m)\u001b[22m\n", - "\u001b[90m @\u001b[39m \u001b[90mBase\u001b[39m \u001b[90m.\\\u001b[39m\u001b[90m\u001b[4mloading.jl:2070\u001b[24m\u001b[39m\n", - " [19] \u001b[0m\u001b[1msoftscope_include_string\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90mm\u001b[39m::\u001b[0mModule, \u001b[90mcode\u001b[39m::\u001b[0mString, \u001b[90mfilename\u001b[39m::\u001b[0mString\u001b[0m\u001b[1m)\u001b[22m\n", - "\u001b[90m @\u001b[39m \u001b[36mSoftGlobalScope\u001b[39m \u001b[90mC:\\Users\\Administrator\\.julia\\packages\\SoftGlobalScope\\u4UzH\\src\\\u001b[39m\u001b[90m\u001b[4mSoftGlobalScope.jl:65\u001b[24m\u001b[39m\n", - " [20] \u001b[0m\u001b[1mexecute_request\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90msocket\u001b[39m::\u001b[0mZMQ.Socket, \u001b[90mmsg\u001b[39m::\u001b[0mIJulia.Msg\u001b[0m\u001b[1m)\u001b[22m\n", - "\u001b[90m @\u001b[39m \u001b[32mIJulia\u001b[39m \u001b[90mC:\\Users\\Administrator\\.julia\\packages\\IJulia\\Vo51o\\src\\\u001b[39m\u001b[90m\u001b[4mexecute_request.jl:67\u001b[24m\u001b[39m\n", - " [21] \u001b[0m\u001b[1m#invokelatest#2\u001b[22m\n", - "\u001b[90m @\u001b[39m \u001b[90m.\\\u001b[39m\u001b[90m\u001b[4messentials.jl:887\u001b[24m\u001b[39m\u001b[90m [inlined]\u001b[39m\n", - " [22] \u001b[0m\u001b[1minvokelatest\u001b[22m\n", - "\u001b[90m @\u001b[39m \u001b[90m.\\\u001b[39m\u001b[90m\u001b[4messentials.jl:884\u001b[24m\u001b[39m\u001b[90m [inlined]\u001b[39m\n", - " [23] \u001b[0m\u001b[1meventloop\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90msocket\u001b[39m::\u001b[0mZMQ.Socket\u001b[0m\u001b[1m)\u001b[22m\n", - "\u001b[90m @\u001b[39m \u001b[32mIJulia\u001b[39m \u001b[90mC:\\Users\\Administrator\\.julia\\packages\\IJulia\\Vo51o\\src\\\u001b[39m\u001b[90m\u001b[4meventloop.jl:8\u001b[24m\u001b[39m\n", - " [24] \u001b[0m\u001b[1m(::IJulia.var\"#15#18\")\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[0m\u001b[1m)\u001b[22m\n", - "\u001b[90m @\u001b[39m \u001b[32mIJulia\u001b[39m \u001b[90mC:\\Users\\Administrator\\.julia\\packages\\IJulia\\Vo51o\\src\\\u001b[39m\u001b[90m\u001b[4meventloop.jl:38\u001b[24m\u001b[39m" + " [18] \u001b[0m\u001b[1meval\u001b[22m\n", + "\u001b[90m @\u001b[39m \u001b[90m.\\\u001b[39m\u001b[90m\u001b[4mboot.jl:370\u001b[24m\u001b[39m\u001b[90m [inlined]\u001b[39m\n", + " [19] \u001b[0m\u001b[1minclude_string\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90mmapexpr\u001b[39m::\u001b[0mtypeof(REPL.softscope), \u001b[90mmod\u001b[39m::\u001b[0mModule, \u001b[90mcode\u001b[39m::\u001b[0mString, \u001b[90mfilename\u001b[39m::\u001b[0mString\u001b[0m\u001b[1m)\u001b[22m\n", + "\u001b[90m @\u001b[39m \u001b[90mBase\u001b[39m \u001b[90m.\\\u001b[39m\u001b[90m\u001b[4mloading.jl:1899\u001b[24m\u001b[39m\n", + " [20] \u001b[0m\u001b[1msoftscope_include_string\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90mm\u001b[39m::\u001b[0mModule, \u001b[90mcode\u001b[39m::\u001b[0mString, \u001b[90mfilename\u001b[39m::\u001b[0mString\u001b[0m\u001b[1m)\u001b[22m\n", + "\u001b[90m @\u001b[39m \u001b[36mSoftGlobalScope\u001b[39m \u001b[90mC:\\Users\\56506\\.julia\\packages\\SoftGlobalScope\\u4UzH\\src\\\u001b[39m\u001b[90m\u001b[4mSoftGlobalScope.jl:65\u001b[24m\u001b[39m\n", + " [21] \u001b[0m\u001b[1mexecute_request\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90msocket\u001b[39m::\u001b[0mZMQ.Socket, \u001b[90mmsg\u001b[39m::\u001b[0mIJulia.Msg\u001b[0m\u001b[1m)\u001b[22m\n", + "\u001b[90m @\u001b[39m \u001b[32mIJulia\u001b[39m \u001b[90mC:\\Users\\56506\\.julia\\packages\\IJulia\\Vo51o\\src\\\u001b[39m\u001b[90m\u001b[4mexecute_request.jl:67\u001b[24m\u001b[39m\n", + " [22] \u001b[0m\u001b[1m#invokelatest#2\u001b[22m\n", + "\u001b[90m @\u001b[39m \u001b[90m.\\\u001b[39m\u001b[90m\u001b[4messentials.jl:816\u001b[24m\u001b[39m\u001b[90m [inlined]\u001b[39m\n", + " [23] \u001b[0m\u001b[1minvokelatest\u001b[22m\n", + "\u001b[90m @\u001b[39m \u001b[90m.\\\u001b[39m\u001b[90m\u001b[4messentials.jl:813\u001b[24m\u001b[39m\u001b[90m [inlined]\u001b[39m\n", + " [24] \u001b[0m\u001b[1meventloop\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90msocket\u001b[39m::\u001b[0mZMQ.Socket\u001b[0m\u001b[1m)\u001b[22m\n", + "\u001b[90m @\u001b[39m \u001b[32mIJulia\u001b[39m \u001b[90mC:\\Users\\56506\\.julia\\packages\\IJulia\\Vo51o\\src\\\u001b[39m\u001b[90m\u001b[4meventloop.jl:8\u001b[24m\u001b[39m\n", + " [25] \u001b[0m\u001b[1m(::IJulia.var\"#15#18\")\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[0m\u001b[1m)\u001b[22m\n", + "\u001b[90m @\u001b[39m \u001b[32mIJulia\u001b[39m \u001b[90m.\\\u001b[39m\u001b[90m\u001b[4mtask.jl:514\u001b[24m\u001b[39m" ] } ], @@ -3629,9 +3639,9 @@ "name": "stdout", "output_type": "stream", "text": [ - "# %% Jupyter Notebook | Julia 1.10.0 @ julia | format 2~4\n", + "# %% Jupyter Notebook | Julia 1.9.1 @ julia | format 2~4\n", "# % language_info: {\"file_extension\":\".jl\",\"mimetype\":\"application/julia\",\"name\":\"julia\",\"version\":\"1.10.0\"}\n", - "# % kernelspec: {\"name\":\"julia-1.10\",\"display_name\":\"Julia 1.10.0\",\"language\":\"julia\"}\n", + "# % kernelspec: {\"name\":\"julia-1.9\",\"display_name\":\"Julia 1.9.1\",\"language\":\"julia\"}\n", "# % nbformat: 4\n", "# % nbformat_minor: 2\n", "\n", @@ -3643,12 +3653,20 @@ "# (✨执行其中所有单元格,可自动构建、测试并生成相应`.jl`源码、测试文件与README!)\n", "\n", "# %% [3] markdown\n", - "# [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits&logoColor=white)](https://conventionalcommits.org)\n", - "# [![Static Badge](https://img.shields.io/badge/julia-package?logo=julia&label=1.7%2B)](https://julialang.org/)\n", + "# ![GitHub License](https://img.shields.io/github/license/ARCJ137442/IpynbCompile.jl?style=for-the-badge&color=a270ba)\n", + "# ![Code Size](https://img.shields.io/github/languages/code-size/ARCJ137442/IpynbCompile.jl?style=for-the-badge&color=a270ba)\n", + "# ![Lines of Code](https://www.aschey.tech/tokei/github.com/ARCJ137442/IpynbCompile.jl?style=for-the-badge&color=a270ba)\n", + "# [![Language](https://img.shields.io/badge/language-Julia%201.7+-purple?style=for-the-badge&color=a270ba)](https://cn.julialang.org/)\n", "# \n", - "# [![CI status](https://github.com/ARCJ137442/IpynbCompile.jl/workflows/CI/badge.svg)](https://github.com/ARCJ137442/IpynbCompile.jl/actions/workflows/ci.yml)\n", + "# 开发状态:\n", "# \n", - "# 该项目使用[语义化版本 2.0.0](https://semver.org/)进行版本号管理。\n", + "# [![CI status](https://img.shields.io/github/actions/workflow/status/ARCJ137442/IpynbCompile.jl/ci.yml?style=for-the-badge)](https://github.com/ARCJ137442/IpynbCompile.jl/actions/workflows/ci.yml)\n", + "# \n", + "# ![Created At](https://img.shields.io/github/created-at/ARCJ137442/IpynbCompile.jl?style=for-the-badge)\n", + "# ![Last Commit](https://img.shields.io/github/last-commit/ARCJ137442/IpynbCompile.jl?style=for-the-badge)\n", + "# \n", + "# [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?style=for-the-badge)](https://conventionalcommits.org)\n", + "# ![GitHub commits since latest release](https://img.shields.io/github/commits-since/ARCJ137442/IpynbCompile.jl/latest?style=for-the-badge)\n", "\n", "# %% [4] markdown\n", "# ## 主要功能\n", @@ -6042,7 +6060,7 @@ "output_type": "stream", "text": [ "\u001b[93m\u001b[1m✅Jupyter笔记本「主模块」自编译成功!\u001b[22m\u001b[39m\n", - "\u001b[93m\u001b[1m(共写入 58552 个字节)\u001b[22m\u001b[39m\n" + "\u001b[93m\u001b[1m(共写入 59246 个字节)\u001b[22m\u001b[39m\n" ] } ], @@ -6198,15 +6216,23 @@ "name": "stdout", "output_type": "stream", "text": [ - "\n", + "\n", "# IpynbCompile.jl: 一个实用的Jupyter笔记本构建工具\n", "\n", - "[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits&logoColor=white)](https://conventionalcommits.org)\n", - "[![Static Badge](https://img.shields.io/badge/julia-package?logo=julia&label=1.7%2B)](https://julialang.org/)\n", + "![GitHub License](https://img.shields.io/github/license/ARCJ137442/IpynbCompile.jl?style=for-the-badge&color=a270ba)\n", + "![Code Size](https://img.shields.io/github/languages/code-size/ARCJ137442/IpynbCompile.jl?style=for-the-badge&color=a270ba)\n", + "![Lines of Code](https://www.aschey.tech/tokei/github.com/ARCJ137442/IpynbCompile.jl?style=for-the-badge&color=a270ba)\n", + "[![Language](https://img.shields.io/badge/language-Julia%201.7+-purple?style=for-the-badge&color=a270ba)](https://cn.julialang.org/)\n", + "\n", + "开发状态:\n", + "\n", + "[![CI status](https://img.shields.io/github/actions/workflow/status/ARCJ137442/IpynbCompile.jl/ci.yml?style=for-the-badge)](https://github.com/ARCJ137442/IpynbCompile.jl/actions/workflows/ci.yml)\n", "\n", - "[![CI status](https://github.com/ARCJ137442/IpynbCompile.jl/workflows/CI/badge.svg)](https://github.com/ARCJ137442/IpynbCompile.jl/actions/workflows/ci.yml)\n", + "![Created At](https://img.shields.io/github/created-at/ARCJ137442/IpynbCompile.jl?style=for-the-badge)\n", + "![Last Commit](https://img.shields.io/github/last-commit/ARCJ137442/IpynbCompile.jl?style=for-the-badge)\n", "\n", - "该项目使用[语义化版本 2.0.0](https://semver.org/)进行版本号管理。\n", + "[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?style=for-the-badge)](https://conventionalcommits.org)\n", + "![GitHub commits since latest release](https://img.shields.io/github/commits-since/ARCJ137442/IpynbCompile.jl/latest?style=for-the-badge)\n", "\n", "## 主要功能\n", "\n", @@ -6478,7 +6504,7 @@ { "data": { "text/plain": [ - "8870" + "9551" ] }, "execution_count": 35, @@ -6540,15 +6566,15 @@ ], "metadata": { "kernelspec": { - "display_name": "Julia 1.10.0", + "display_name": "Julia 1.9.1", "language": "julia", - "name": "julia-1.10" + "name": "julia-1.9" }, "language_info": { "file_extension": ".jl", "mimetype": "application/julia", "name": "julia", - "version": "1.10.0" + "version": "1.9.1" } }, "nbformat": 4, diff --git a/src/IpynbCompile.jl b/src/IpynbCompile.jl index 369ac70..5cb58b0 100644 --- a/src/IpynbCompile.jl +++ b/src/IpynbCompile.jl @@ -1,6 +1,6 @@ -# %% Jupyter Notebook | Julia 1.10.0 @ julia | format 2~4 +# %% Jupyter Notebook | Julia 1.9.1 @ julia | format 2~4 # % language_info: {"file_extension":".jl","mimetype":"application/julia","name":"julia","version":"1.10.0"} -# % kernelspec: {"name":"julia-1.10","display_name":"Julia 1.10.0","language":"julia"} +# % kernelspec: {"name":"julia-1.9","display_name":"Julia 1.9.1","language":"julia"} # % nbformat: 4 # % nbformat_minor: 2 @@ -12,12 +12,20 @@ # (✨执行其中所有单元格,可自动构建、测试并生成相应`.jl`源码、测试文件与README!) # %% [3] markdown -# [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits&logoColor=white)](https://conventionalcommits.org) -# [![Static Badge](https://img.shields.io/badge/julia-package?logo=julia&label=1.7%2B)](https://julialang.org/) +# ![GitHub License](https://img.shields.io/github/license/ARCJ137442/IpynbCompile.jl?style=for-the-badge&color=a270ba) +# ![Code Size](https://img.shields.io/github/languages/code-size/ARCJ137442/IpynbCompile.jl?style=for-the-badge&color=a270ba) +# ![Lines of Code](https://www.aschey.tech/tokei/github.com/ARCJ137442/IpynbCompile.jl?style=for-the-badge&color=a270ba) +# [![Language](https://img.shields.io/badge/language-Julia%201.7+-purple?style=for-the-badge&color=a270ba)](https://cn.julialang.org/) +# +# 开发状态: +# +# [![CI status](https://img.shields.io/github/actions/workflow/status/ARCJ137442/IpynbCompile.jl/ci.yml?style=for-the-badge)](https://github.com/ARCJ137442/IpynbCompile.jl/actions/workflows/ci.yml) # -# [![CI status](https://github.com/ARCJ137442/IpynbCompile.jl/workflows/CI/badge.svg)](https://github.com/ARCJ137442/IpynbCompile.jl/actions/workflows/ci.yml) +# ![Created At](https://img.shields.io/github/created-at/ARCJ137442/IpynbCompile.jl?style=for-the-badge) +# ![Last Commit](https://img.shields.io/github/last-commit/ARCJ137442/IpynbCompile.jl?style=for-the-badge) # -# 该项目使用[语义化版本 2.0.0](https://semver.org/)进行版本号管理。 +# [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?style=for-the-badge)](https://conventionalcommits.org) +# ![GitHub commits since latest release](https://img.shields.io/github/commits-since/ARCJ137442/IpynbCompile.jl/latest?style=for-the-badge) # %% [4] markdown # ## 主要功能