Skip to content

Commit eda1b20

Browse files
Clean up and enhance high-level RDoc (#65)
1 parent 83bd4dc commit eda1b20

File tree

7 files changed

+48
-45
lines changed

7 files changed

+48
-45
lines changed

Diff for: README.md

+2-14
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,9 @@ REXML was inspired by the Electric XML library for Java, which features an easy-
44

55
REXML supports both tree and stream document parsing. Stream parsing is faster (about 1.5 times as fast). However, with stream parsing, you don't get access to features such as XPath.
66

7-
## Installation
7+
## API
88

9-
Add this line to your application's Gemfile:
10-
11-
```ruby
12-
gem 'rexml'
13-
```
14-
15-
And then execute:
16-
17-
$ bundle
18-
19-
Or install it yourself as:
20-
21-
$ gem install rexml
9+
See the {API documentation}[https://ruby.github.io/rexml/]
2210

2311
## Usage
2412

Diff for: doc/rexml/tasks/tocs/master_toc.rdoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
== Table of Contents
1+
== Tasks
22

33
=== {Child}[../../tasks/rdoc/child_rdoc.html]
44
- {Relationships}[../../tasks/rdoc/child_rdoc.html#label-Relationships]

Diff for: lib/rexml/document.rb

+9
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ module REXML
2323
# - A document type.
2424
# - Processing instructions.
2525
#
26+
# == In a Hurry?
27+
#
28+
# If you're somewhat familiar with XML
29+
# and have a particular task in mind,
30+
# you may want to see the
31+
# {tasks pages}[../doc/rexml/tasks/tocs/master_toc_rdoc.html],
32+
# and in particular, the
33+
# {tasks page for documents}[../doc/rexml/tasks/tocs/document_toc_rdoc.html].
34+
#
2635
class Document < Element
2736
# A convenient default XML declaration. Use:
2837
#

Diff for: lib/rexml/element.rb

+9
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@ module REXML
2727
# (other elements, text, CDATA, processing instructions, and comments).
2828
# - Has zero or more named attributes.
2929
#
30+
# == In a Hurry?
31+
#
32+
# If you're somewhat familiar with XML
33+
# and have a particular task in mind,
34+
# you may want to see the
35+
# {tasks pages}[../doc/rexml/tasks/tocs/master_toc_rdoc.html],
36+
# and in particular, the
37+
# {tasks page for elements}[../doc/rexml/tasks/tocs/element_toc_rdoc.html].
38+
#
3039
# === Name
3140
#
3241
# An element has a name, which is initially set when the element is created:

Diff for: lib/rexml/light/node.rb

-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
# frozen_string_literal: false
22
require_relative '../xmltokens'
33

4-
# [ :element, parent, name, attributes, children* ]
5-
# a = Node.new
6-
# a << "B" # => <a>B</a>
7-
# a.b # => <a>B<b/></a>
8-
# a.b[1] # => <a>B<b/><b/><a>
9-
# a.b[1]["x"] = "y" # => <a>B<b/><b x="y"/></a>
10-
# a.b[0].c # => <a>B<b><c/></b><b x="y"/></a>
11-
# a.b.c << "D" # => <a>B<b><c>D</c></b><b x="y"/></a>
124
module REXML
135
module Light
146
# Represents a tagged XML element. Elements are characterized by

Diff for: lib/rexml/rexml.rb

+26-21
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,31 @@
11
# -*- coding: utf-8 -*-
22
# frozen_string_literal: false
3-
# REXML is an XML toolkit for Ruby[http://www.ruby-lang.org], in Ruby.
4-
#
5-
# REXML is a _pure_ Ruby, XML 1.0 conforming,
6-
# non-validating[http://www.w3.org/TR/2004/REC-xml-20040204/#sec-conformance]
7-
# toolkit with an intuitive API. REXML passes 100% of the non-validating Oasis
8-
# tests[http://www.oasis-open.org/committees/xml-conformance/xml-test-suite.shtml],
9-
# and provides tree, stream, SAX2, pull, and lightweight APIs. REXML also
10-
# includes a full XPath[http://www.w3c.org/tr/xpath] 1.0 implementation. Since
11-
# Ruby 1.8, REXML is included in the standard Ruby distribution.
12-
#
13-
# Main page:: http://www.germane-software.com/software/rexml
14-
# Author:: Sean Russell <serATgermaneHYPHENsoftwareDOTcom>
15-
# Date:: 2008/019
16-
# Version:: 3.1.7.3
17-
#
18-
# This API documentation can be downloaded from the REXML home page, or can
19-
# be accessed online[http://www.germane-software.com/software/rexml_doc]
20-
#
21-
# A tutorial is available in the REXML distribution in docs/tutorial.html,
22-
# or can be accessed
23-
# online[http://www.germane-software.com/software/rexml/docs/tutorial.html]
3+
#
4+
# \Module \REXML provides classes and methods for parsing,
5+
# editing, and generating XML.
6+
#
7+
# == Implementation
8+
#
9+
# \REXML:
10+
# - Is pure Ruby.
11+
# - Provides tree, stream, SAX2, pull, and lightweight APIs.
12+
# - Conforms to {XML version 1.0}[https://www.w3.org/TR/REC-xml/].
13+
# - Fully implements {XPath version 1.0}[http://www.w3c.org/tr/xpath].
14+
# - Is {non-validating}[https://www.w3.org/TR/xml/].
15+
# - Passes 100% of the non-validating {Oasis tests}[http://www.oasis-open.org/committees/xml-conformance/xml-test-suite.shtml].
16+
#
17+
# == In a Hurry?
18+
#
19+
# If you're somewhat familiar with XML
20+
# and have a particular task in mind,
21+
# you may want to see {the tasks pages}[doc/rexml/tasks/tocs/master_toc_rdoc.html].
22+
#
23+
# == API
24+
#
25+
# Among the most important classes for using \REXML are:
26+
# - REXML::Document.
27+
# - REXML::Element.
28+
#
2429
module REXML
2530
COPYRIGHT = "Copyright © 2001-2008 Sean Russell <[email protected]>"
2631
DATE = "2008/019"

Diff for: tasks/tocs.rake

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class TOCsGenerator
4545

4646
def generate_files(lis_by_name)
4747
File.open('tocs/master_toc.rdoc', 'w') do |master_toc_file|
48-
master_toc_file.write("== Table of Contents\n\n")
48+
master_toc_file.write("== Tasks\n\n")
4949
cd('tocs') do
5050
entries = Dir.entries('.')
5151
entries.delete_if {|entry| entry.start_with?('.') }

0 commit comments

Comments
 (0)