herbst 0.0.1 → 0.1.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.
@@ -0,0 +1,123 @@
1
+ # Generated from lib/herbst/slim/converter.rb with RBS::Inline
2
+
3
+ module Herbst
4
+ module Slim
5
+ class Converter < Herbst::Converter
6
+ HYPHEN_ATTRIBUTES: Array[String]
7
+
8
+ @options: Hash[Symbol, untyped]
9
+
10
+ # : (?Hash[Symbol, untyped]) -> void
11
+ def initialize: (?Hash[Symbol, untyped]) -> void
12
+
13
+ # : (String) -> Herb::AST::DocumentNode
14
+ def convert: (String) -> Herb::AST::DocumentNode
15
+
16
+ private
17
+
18
+ # : (Array[untyped]) -> Array[untyped]
19
+ def prepare: (Array[untyped]) -> Array[untyped]
20
+
21
+ # : (untyped) -> Array[untyped]
22
+ def flatten: (untyped) -> Array[untyped]
23
+
24
+ # : (untyped) -> bool
25
+ def control?: (untyped) -> bool
26
+
27
+ # : (untyped) -> bool
28
+ def clause?: (untyped) -> bool
29
+
30
+ # : (Array[untyped], Integer) -> Array[Herb::AST::Node]
31
+ def join: (Array[untyped], Integer) -> Array[Herb::AST::Node]
32
+
33
+ # : (untyped, Integer) -> Array[Herb::AST::Node]
34
+ def body: (untyped, Integer) -> Array[Herb::AST::Node]
35
+
36
+ # : (untyped) -> bool
37
+ def block?: (untyped) -> bool
38
+
39
+ # : (untyped, Integer) -> Array[Herb::AST::Node]
40
+ def convert_item: (untyped, Integer) -> Array[Herb::AST::Node]
41
+
42
+ # : (untyped, Integer) -> Array[Herb::AST::Node]
43
+ def convert_html: (untyped, Integer) -> Array[Herb::AST::Node]
44
+
45
+ # : (untyped, Integer) -> Array[Herb::AST::Node]
46
+ def convert_slim: (untyped, Integer) -> Array[Herb::AST::Node]
47
+
48
+ # : (untyped) -> bot
49
+ def unexpected: (untyped) -> bot
50
+
51
+ # : (untyped) -> Array[Herb::AST::Node]
52
+ def convert_text: (untyped) -> Array[Herb::AST::Node]
53
+
54
+ # : (String, ?escape_static: bool) -> Array[Herb::AST::Node]
55
+ def interpolate: (String, ?escape_static: bool) -> Array[Herb::AST::Node]
56
+
57
+ # : (untyped, Integer) -> Array[Herb::AST::Node]
58
+ def convert_tag: (untyped, Integer) -> Array[Herb::AST::Node]
59
+
60
+ # : (untyped, Integer) -> Array[Herb::AST::Node]
61
+ def convert_output: (untyped, Integer) -> Array[Herb::AST::Node]
62
+
63
+ # : (String, untyped, Array[untyped], Integer) -> Array[Herb::AST::Node]
64
+ def convert_control: (String, untyped, Array[untyped], Integer) -> Array[Herb::AST::Node]
65
+
66
+ # Slim also accepts the `- when` lines of a `- case` indented under it.
67
+ #
68
+ # : (untyped) -> [untyped, Array[untyped]]
69
+ def nested_clauses: (untyped) -> [ untyped, Array[untyped] ]
70
+
71
+ # Slim compiles each line of code onto its own line of Ruby, but in ERB the next tag follows on
72
+ # the same line, where a trailing comment would swallow it. The comment moves into an ERB comment.
73
+ #
74
+ # : (String) -> [String, String?]
75
+ def split_comment: (String) -> [ String, String? ]
76
+
77
+ # : (String?) -> Array[Herb::AST::Node]
78
+ def comment_nodes: (String?) -> Array[Herb::AST::Node]
79
+
80
+ # : (String) -> bool
81
+ def opens_block?: (String) -> bool
82
+
83
+ # : (String) -> String
84
+ def block_code: (String) -> String
85
+
86
+ # : (String) -> Array[Herb::AST::Node]
87
+ def convert_doctype: (String) -> Array[Herb::AST::Node]
88
+
89
+ # : (untyped, Integer) -> Array[Herb::AST::Node]
90
+ def convert_embedded: (untyped, Integer) -> Array[Herb::AST::Node]
91
+
92
+ # : (String, Integer) -> Array[Herb::AST::Node]
93
+ def embedded_body: (String, Integer) -> Array[Herb::AST::Node]
94
+
95
+ # : (untyped) -> Array[Herb::AST::Node]
96
+ def convert_attributes: (untyped) -> Array[Herb::AST::Node]
97
+
98
+ # : (Array[untyped]) -> Array[Herb::AST::Node]
99
+ def convert_class: (Array[untyped]) -> Array[Herb::AST::Node]
100
+
101
+ # : (untyped) -> Array[Herb::AST::Node]
102
+ def class_value: (untyped) -> Array[Herb::AST::Node]
103
+
104
+ # : (String, bool) -> Array[Herb::AST::Node]
105
+ def attribute_value: (String, bool) -> Array[Herb::AST::Node]
106
+
107
+ # : (String) -> String
108
+ def static_class: (String) -> String
109
+
110
+ # : (String, untyped) -> Array[Herb::AST::Node]
111
+ def convert_attribute: (String, untyped) -> Array[Herb::AST::Node]
112
+
113
+ # : (String, bool, String) -> Array[Herb::AST::Node]
114
+ def convert_hash_attribute: (String, bool, String) -> Array[Herb::AST::Node]
115
+
116
+ # : (String) -> Array[[String, String]]?
117
+ def hash_entries: (String) -> Array[[ String, String ]]?
118
+
119
+ # : (String, bool, String) -> Array[Herb::AST::Node]
120
+ def convert_code_attribute: (String, bool, String) -> Array[Herb::AST::Node]
121
+ end
122
+ end
123
+ end
@@ -0,0 +1,17 @@
1
+ # Generated from lib/herbst/slim.rb with RBS::Inline
2
+
3
+ module Herbst
4
+ # Converts Slim templates into Herb's syntax tree and ERB.
5
+ #
6
+ # Herbst::Slim.parse("p = greeting") # => Herb::AST::DocumentNode
7
+ # Herbst::Slim.to_erb("p = greeting") # => "<p><%= greeting %></p>"
8
+ #
9
+ # The slim gem is only needed when converting Slim, so it isn't a dependency of Herbst.
10
+ module Slim
11
+ # : (String, **untyped) -> Herb::AST::DocumentNode
12
+ def self.parse: (String, **untyped) -> Herb::AST::DocumentNode
13
+
14
+ # : (String, ?format: bool, **untyped) -> String
15
+ def self.to_erb: (String, ?format: bool, **untyped) -> String
16
+ end
17
+ end
@@ -0,0 +1,5 @@
1
+ # Generated from lib/herbst/version.rb with RBS::Inline
2
+
3
+ module Herbst
4
+ VERSION: ::String
5
+ end
data/sig/herbst.rbs CHANGED
@@ -1,3 +1,13 @@
1
+ # Generated from lib/herbst.rb with RBS::Inline
2
+
1
3
  module Herbst
2
- VERSION: String
4
+ class Error < StandardError
5
+ end
6
+
7
+ class UnsupportedError < Error
8
+ attr_reader line: Integer?
9
+
10
+ # : (String, ?Integer?) -> void
11
+ def initialize: (String, ?Integer?) -> void
12
+ end
3
13
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: herbst
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marco Roth
@@ -15,36 +15,64 @@ dependencies:
15
15
  requirements:
16
16
  - - ">="
17
17
  - !ruby/object:Gem::Version
18
- version: '0'
18
+ version: 0.11.1
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - ">="
24
24
  - !ruby/object:Gem::Version
25
- version: '0'
25
+ version: 0.11.1
26
26
  description: Herbst provides tooling to translate Haml, Slim, and other HTML templating
27
27
  languages into the unified syntax tree used by Herb, enabling HTML-aware tooling
28
28
  across different HTML templating languages.
29
29
  email:
30
30
  - marco.roth@intergga.ch
31
- executables: []
31
+ executables:
32
+ - herbst
32
33
  extensions: []
33
34
  extra_rdoc_files: []
34
35
  files:
35
36
  - LICENSE.txt
36
37
  - README.md
37
38
  - Rakefile
39
+ - exe/herbst
38
40
  - herbst.gemspec
39
41
  - lib/herbst.rb
42
+ - lib/herbst/builder.rb
43
+ - lib/herbst/cli.rb
44
+ - lib/herbst/converter.rb
45
+ - lib/herbst/haml.rb
46
+ - lib/herbst/haml/attributes.rb
47
+ - lib/herbst/haml/converter.rb
48
+ - lib/herbst/haml/filters.rb
49
+ - lib/herbst/identity_printer.rb
50
+ - lib/herbst/printer.rb
51
+ - lib/herbst/round_trip.rb
52
+ - lib/herbst/slim.rb
53
+ - lib/herbst/slim/converter.rb
40
54
  - lib/herbst/version.rb
41
55
  - sig/herbst.rbs
56
+ - sig/herbst/builder.rbs
57
+ - sig/herbst/cli.rbs
58
+ - sig/herbst/converter.rbs
59
+ - sig/herbst/haml.rbs
60
+ - sig/herbst/haml/attributes.rbs
61
+ - sig/herbst/haml/converter.rbs
62
+ - sig/herbst/haml/filters.rbs
63
+ - sig/herbst/identity_printer.rbs
64
+ - sig/herbst/printer.rbs
65
+ - sig/herbst/round_trip.rbs
66
+ - sig/herbst/slim.rbs
67
+ - sig/herbst/slim/converter.rbs
68
+ - sig/herbst/version.rbs
42
69
  homepage: https://github.com/marcoroth/herbst
43
- licenses: []
70
+ licenses:
71
+ - MIT
44
72
  metadata:
45
73
  homepage_uri: https://github.com/marcoroth/herbst
46
74
  source_code_uri: https://github.com/marcoroth/herbst
47
- changelog_uri: https://github.com/marcoroth/herbst/blob/main/CHANGELOG.md
75
+ changelog_uri: https://github.com/marcoroth/herbst/releases
48
76
  rubygems_mfa_required: 'true'
49
77
  rdoc_options: []
50
78
  require_paths: