yard-rustdoc 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +9 -5
- data/lib/yard-rustdoc/parser.rb +3 -1
- data/lib/yard-rustdoc/statements.rb +1 -1
- data/lib/yard-rustdoc/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9e27bb76802a3dcf98f4c78e30ed98251aed81e4927e464f2da5989768d0328
|
4
|
+
data.tar.gz: 8a96e1280b7bca47976e4d2b74da7a1be05f34428f6d6c1f65528079f2532e49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 765bf4cc6f745a9f4d91cbf6eaf17dbf5db45567979bf009d72c684ce6b0e67e6c22ffb2f0f2003b14ce75fef31dd7f4080f36af265d0aa45113d3d141af2689
|
7
|
+
data.tar.gz: 89d3d49913d6ae12be8819472a7536a76b92074cf75828f84571d8125b45049b18ac41fe3cb8553c5e70851b183fdd2de6c083b0626fccfa304bc34f74ba5962
|
data/README.md
CHANGED
@@ -1,16 +1,15 @@
|
|
1
1
|
# YARD::Rustdoc
|
2
2
|
|
3
3
|
YARD plugin for documenting Magnus-based Rust gems. Supports writing class
|
4
|
-
documentation on Struct and method documentation on Struct
|
5
|
-
|
6
|
-
**Note**: WIP, not released.
|
4
|
+
documentation on Struct and Enums, and method documentation on Struct and Enum
|
5
|
+
methods.
|
7
6
|
|
8
7
|
## Installation
|
9
8
|
|
10
9
|
Add this line to your application's Gemfile:
|
11
10
|
|
12
11
|
```ruby
|
13
|
-
gem
|
12
|
+
gem "yard-rustdoc"
|
14
13
|
```
|
15
14
|
|
16
15
|
Load the plugin through `--plugin rustdoc` (e.g. in your project's `.yardopts`).
|
@@ -73,12 +72,16 @@ impl Bar {
|
|
73
72
|
}
|
74
73
|
```
|
75
74
|
|
76
|
-
Defines `Foo::Bar#baz
|
75
|
+
Defines `Foo::Bar#baz` and `#qux` -- instance method because the method's first
|
76
|
+
argument is either `&self` or `rb_self`.
|
77
77
|
|
78
78
|
```rust
|
79
79
|
impl Bar {
|
80
80
|
/// @yard
|
81
81
|
fn baz(&self) {}
|
82
|
+
|
83
|
+
/// @yard
|
84
|
+
fn qux(rb_self: Value) {}
|
82
85
|
}
|
83
86
|
```
|
84
87
|
|
@@ -111,6 +114,7 @@ YARD's syntax differs from what Rustdoc expects. Linters you man want to disable
|
|
111
114
|
```rust
|
112
115
|
#![allow(rustdoc::broken_intra_doc_links)]
|
113
116
|
#![allow(rustdoc::invalid_html_tags)]
|
117
|
+
#![allow(rustdoc::bare_urls)]
|
114
118
|
```
|
115
119
|
|
116
120
|
## Development
|
data/lib/yard-rustdoc/parser.rb
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
module YARD::Parser::Rustdoc
|
4
4
|
class Parser < YARD::Parser::Base
|
5
|
+
TOP_LEVEL_KINDS = ["struct", "enum"].freeze
|
6
|
+
|
5
7
|
# This default constructor does nothing. The subclass is responsible for
|
6
8
|
# storing the source contents and filename if they are required.
|
7
9
|
# @param [String] source the source contents
|
@@ -28,7 +30,7 @@ module YARD::Parser::Rustdoc
|
|
28
30
|
|
29
31
|
@rustdoc_json.each do |id, entry|
|
30
32
|
next unless relevant_entry?(entry)
|
31
|
-
next unless entry["kind"]
|
33
|
+
next unless TOP_LEVEL_KINDS.include?(entry["kind"])
|
32
34
|
|
33
35
|
methods = entry
|
34
36
|
.dig("inner", "impls")
|
data/lib/yard-rustdoc/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yard-rustdoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jimmy Bourassa
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: yard
|
@@ -115,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
115
115
|
- !ruby/object:Gem::Version
|
116
116
|
version: '0'
|
117
117
|
requirements: []
|
118
|
-
rubygems_version: 3.3.
|
118
|
+
rubygems_version: 3.3.24
|
119
119
|
signing_key:
|
120
120
|
specification_version: 4
|
121
121
|
summary: Generate YARD documentation for Magnus-based Rust gems.
|