Skip to content

Commit d388d38

Browse files
authored
Bump version and remove DataStructures dep (#11)
1 parent 31f010c commit d388d38

3 files changed

Lines changed: 12 additions & 24 deletions

File tree

.github/workflows/CompatHelper.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

Project.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
name = "QMDDocTools"
22
uuid = "c50e25eb-ade4-4c96-a757-2a1fd62cbd8c"
3+
version = "1.2.1"
34
authors = ["nhz2 <nhz2@cornell.edu> and contributors"]
4-
version = "1.2.0"
55

66
[deps]
7-
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
87
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
98
REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
109
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"
1110

1211
[compat]
13-
DataStructures = "0.18"
1412
julia = "1.10"

src/QMDDocTools.jl

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ module QMDDocTools
22

33
export gen_docstrings
44

5-
using DataStructures
65
using Markdown
76
using SHA
87
using REPL: REPL
@@ -159,8 +158,8 @@ function gen_docstrings(pkgmodule::Module;
159158
)
160159
metadicts = Docs.meta.(getpkgmodules(pkgmodule))
161160
pkgpath = pkgdir(pkgmodule)
162-
srcfiles = DefaultDict{String, DefaultDict{String, Vector{Docs.DocStr}}}(()->(DefaultDict{String, Vector{Docs.DocStr}}([])))
163-
bindingfiles = DefaultDict{String, Vector{Docs.DocStr}}(()->[])
161+
srcfiles = Dict{String, Dict{String, Vector{Docs.DocStr}}}()
162+
bindingfiles = Dict{String, Vector{Docs.DocStr}}()
164163
for metadict in metadicts
165164
for (binding, md) in metadict
166165
#add file for binding
@@ -173,8 +172,15 @@ function gen_docstrings(pkgmodule::Module;
173172
error("docstring\n$d\ndoesn't have a valid path.")
174173
end
175174
relfilename = get_relative_path(absfilename, pkgpath)
176-
push!(srcfiles[relfilename][bindingstr],d)
177-
push!(bindingfiles[bindingstr],d)
175+
push!(
176+
get!(
177+
Vector{Docs.DocStr},
178+
get!(Dict{String, Vector{Docs.DocStr}}, srcfiles, relfilename),
179+
bindingstr,
180+
),
181+
d,
182+
)
183+
push!(get!(Vector{Docs.DocStr}, bindingfiles, bindingstr), d)
178184
end
179185
end
180186
end

0 commit comments

Comments
 (0)