From ecd0d1c7b7f8c6b34d4f1fece9b4277a0cd47765 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Tue, 2 Jan 2024 08:33:46 +0900 Subject: [PATCH] update to 1.10 & add doc for print, importing --- README.adoc | 3 ++- docs/Project.toml | 1 + docs/src/index.md | 2 ++ src/print.jl | 10 ++++++++-- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/README.adoc b/README.adoc index d0772bd..ef39de9 100644 --- a/README.adoc +++ b/README.adoc @@ -14,7 +14,8 @@ ** Inspecting with GUI == TODO -- [ ] Printing +- [x] Printing - [ ] visualize +- [ ] interactive edit - [ ] doc diff --git a/docs/Project.toml b/docs/Project.toml index dfa65cd..c36628f 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -1,2 +1,3 @@ [deps] +CoordVisualize = "4c41ebcf-33aa-4478-9aac-83d12758d145" Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" diff --git a/docs/src/index.md b/docs/src/index.md index de514c8..f3ac26f 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -29,3 +29,5 @@ You can also edit existing notes with [`assign_note!`](@ref). ### Exporting Use [`export_log`](@ref) to export log to `io` or `file`. +### Importing +Do `using Dates` first and just `include("filename")` and it will return `Vector{CoordLog}`. diff --git a/src/print.jl b/src/print.jl index 8c173ca..f10c038 100644 --- a/src/print.jl +++ b/src/print.jl @@ -18,11 +18,17 @@ function export_log(logs::Vector{CoordLog}) (s -> "[\n" * s * "\n]") end -function export_log(io::IO, log::CoordLog) +""" + export_log(io::IO, log) +""" +function export_log(io::IO, log) write(io, export_log(log)) end -function export_log(file::AbstractString, log::CoordLog) +""" + export_log(file::AbstractString, log) +""" +function export_log(file::AbstractString, log) open(file, "w") do f export_log(f, log) end