htmldog 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/History.txt +6 -0
- data/Manifest.txt +6 -0
- data/README.txt +41 -0
- data/Rakefile +20 -0
- data/bin/htmldog +73 -0
- data/lib/htmldog.rb +10 -0
- data/test/test_htmldog.rb +0 -0
- metadata +92 -0
- metadata.gz.sig +0 -0
data.tar.gz.sig
ADDED
Binary file
|
data/History.txt
ADDED
data/Manifest.txt
ADDED
data/README.txt
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
= htmldog
|
2
|
+
|
3
|
+
* http://theresistancearmy.com/gems/htmldog
|
4
|
+
* http://rubyforge.org/projects/htmldog
|
5
|
+
|
6
|
+
== DESCRIPTION:
|
7
|
+
|
8
|
+
* A command line tool for html tag / css property documentation using htmldog.com as the data source.
|
9
|
+
|
10
|
+
== FEATURES/PROBLEMS:
|
11
|
+
|
12
|
+
* Fetches documentation including for html tags and css properties from htmldog.com.
|
13
|
+
|
14
|
+
== SYNOPSIS:
|
15
|
+
|
16
|
+
htmldog img
|
17
|
+
|
18
|
+
Image.
|
19
|
+
Note: When an image is used as a link, many browsers will show a border around the image. To get rid of this you should use CSS (border: 0).
|
20
|
+
Required Attributes
|
21
|
+
* src is used to specify the location of the image file.
|
22
|
+
* alt is used to specify the alternative text of the image, which should be a short description.
|
23
|
+
Optional Attributes
|
24
|
+
* longdesc can be used to specify the location (in the form of a URI) of a description of the image.
|
25
|
+
* height can be used to define the height of the image (in pixels). This can also be done with CSS.
|
26
|
+
* width can be used to define the width of the image (in pixels). This can also be done with CSS.
|
27
|
+
Example
|
28
|
+
|
29
|
+
<img src="http://www.htmldog.com/images/logo.gif" alt="HTML Dog" />
|
30
|
+
|
31
|
+
== REQUIREMENTS:
|
32
|
+
|
33
|
+
* rubygems, hpricot
|
34
|
+
|
35
|
+
== INSTALL:
|
36
|
+
|
37
|
+
* sudo gem install htmldog
|
38
|
+
|
39
|
+
== LICENSE:
|
40
|
+
|
41
|
+
Public Domain. Free as the air you breathe. Do whatever you want. No warranty given.
|
data/Rakefile
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# -*- ruby -*-
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'hoe'
|
5
|
+
require './lib/htmldog.rb'
|
6
|
+
|
7
|
+
HOE = Hoe.new('htmldog', Htmldog::VERSION) do |p|
|
8
|
+
p.rubyforge_name = 'htmldog'
|
9
|
+
p.developer('shane becker', 'veganstraightedge@gmail.com')
|
10
|
+
p.remote_rdoc_dir = '' # Release to root
|
11
|
+
end
|
12
|
+
|
13
|
+
namespace :gem do
|
14
|
+
task :spec do
|
15
|
+
File.open("#{HOE.name}.gemspec", 'w') do |f|
|
16
|
+
HOE.spec.version = "#{HOE.version}.#{Time.now.strftime("%Y%m%d%H%M%S")}"
|
17
|
+
f.write(HOE.spec.to_ruby)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/bin/htmldog
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'hpricot'
|
5
|
+
require 'open-uri'
|
6
|
+
require 'htmldog'
|
7
|
+
|
8
|
+
include Htmldog
|
9
|
+
|
10
|
+
# checks for at least one arg
|
11
|
+
if ARGV.size.zero?
|
12
|
+
puts <<-END_OF_STRING
|
13
|
+
|
14
|
+
Example Usage: h float
|
15
|
+
where "float" is a CSS property,
|
16
|
+
or it can be an HTML tag like "div".
|
17
|
+
Only one search item at a time (for now).
|
18
|
+
|
19
|
+
END_OF_STRING
|
20
|
+
exit 1
|
21
|
+
end
|
22
|
+
|
23
|
+
# deals with namespacing based on the q arg
|
24
|
+
q = ARGV.shift
|
25
|
+
if HTML_TAGS.include?(q)
|
26
|
+
name_space = "htmltags"
|
27
|
+
elsif CSS_PROPERTIES.include?(q)
|
28
|
+
name_space = "cssproperties"
|
29
|
+
else
|
30
|
+
puts <<-END_OF_STRING
|
31
|
+
#{q}: No results found.
|
32
|
+
Maybe you mispelled it or it doesn't exist.
|
33
|
+
htmldog.com is used as the data source,
|
34
|
+
so if they don't have it, I can't find it.
|
35
|
+
|
36
|
+
END_OF_STRING
|
37
|
+
exit 1
|
38
|
+
end
|
39
|
+
|
40
|
+
# is the q one of the headings?
|
41
|
+
# on htmldog.com all of the h1-h6 tags are on one page
|
42
|
+
# h1h2h3h4h5h6
|
43
|
+
q = HEADINGS_URL if HEADINGS.include?(q)
|
44
|
+
|
45
|
+
# gets htmldog.com page for q tag or property
|
46
|
+
doc = Hpricot(open("http://htmldog.com/reference/#{name_space}/#{q}/"))
|
47
|
+
|
48
|
+
# chews up the html and prepares slimmed down version
|
49
|
+
intro = (doc/"#intro")
|
50
|
+
antiintro = (doc/"#ai2").inner_html
|
51
|
+
|
52
|
+
# header output
|
53
|
+
(intro/:p).each do |p|
|
54
|
+
puts p.inner_text
|
55
|
+
end
|
56
|
+
|
57
|
+
# possible values/attributes
|
58
|
+
title = (doc/"#c1").inner_html
|
59
|
+
h2s = (doc/"div[@id=ai2]/h2")
|
60
|
+
uls = (doc/"div[@id=ai2]/ul")
|
61
|
+
example = (doc/"div[@id=ai2]/pre/code")
|
62
|
+
|
63
|
+
h2s.zip(uls).each do |h2, ul|
|
64
|
+
puts h2.inner_text
|
65
|
+
|
66
|
+
if ul
|
67
|
+
ul.search("/li").each do |li|
|
68
|
+
puts " * #{li.inner_text}" unless li.inner_text == "Common attributes"
|
69
|
+
end
|
70
|
+
else
|
71
|
+
puts example.first.inner_text
|
72
|
+
end
|
73
|
+
end
|
data/lib/htmldog.rb
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
module Htmldog
|
2
|
+
VERSION = '1.0.0'
|
3
|
+
|
4
|
+
HTML_TAGS = %w[a abbr acronym address area b base bdo big blockquote body br button caption cite code col colgroup dd del dfn div dl DOCTYPE dt em fieldset form h1 h2 h3 h4 h5 h6 head html hr i img input ins kbd label legend li link map meta noscript object ol optgroup option p param pre q samp script select small span strong style sub sup table tbody td textarea tfoot th thead title tr tt ul var]
|
5
|
+
|
6
|
+
HEADINGS = %w[h1 h2 h3 h4 h5 h6]
|
7
|
+
HEADINGS_URL = "h1h2h3h4h5h6"
|
8
|
+
|
9
|
+
CSS_PROPERTIES = %w[background background-attachment background-color background-image background-position background-repeat border border-collapse border-color border-spacing border-style border-width bottom caption-side clear clip color content counter-increment counter-reset cursor direction display empty-cells float font font-family font-size font-style font-variant font-weight height left letter-spacing line-height list-style list-style-image list-style-position list-style-type margin max-height max-width min-height min-width orphans outline outline-color outline-style outline-width overflow padding page-break-after page-break-before page-break-inside position quotes right table-layout text-align text-decoration text-indent text-transform top unicode-bidi vertical-align visibility white-space widows width word-spacing z-index]
|
10
|
+
end
|
File without changes
|
metadata
ADDED
@@ -0,0 +1,92 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: htmldog
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- shane becker
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain:
|
11
|
+
- |
|
12
|
+
-----BEGIN CERTIFICATE-----
|
13
|
+
MIIDRDCCAiygAwIBAgIBADANBgkqhkiG9w0BAQUFADBIMRowGAYDVQQDDBF2ZWdh
|
14
|
+
bnN0cmFpZ2h0ZWRnZTEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPy
|
15
|
+
LGQBGRYDY29tMB4XDTA4MTEwOTA0MjkzNFoXDTA5MTEwOTA0MjkzNFowSDEaMBgG
|
16
|
+
A1UEAwwRdmVnYW5zdHJhaWdodGVkZ2UxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDET
|
17
|
+
MBEGCgmSJomT8ixkARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
|
18
|
+
ggEBAMlSloQVoHL+ZmSBnBgLzDKfKEOUS9/Om9Wn/hFv42VoTaWjPDnIXxYBgM8Z
|
19
|
+
Y4nN6++v/W1zqzhHjZ1/BcUddf+eCao44ZPYuZzbAzWfzsw/1A0RpljrOL6/QwgQ
|
20
|
+
Ukqdtep88Un7kjZbCCOvhHDO3s0uWx+zMwDnXZHWSMcisBFr5ROtxPPP2TNZ2OIF
|
21
|
+
k5DBmRG+gJFrxRcLjw7/2HwC85Y6/K/03Xd3opT9Usx4mmAxoWNQdHRziLdRZkqa
|
22
|
+
8I8QZGLEzYBlGU2HtoS589H4yvniGZ5uRFNq8IDky17082U8UIV1/fA/AD1zafXM
|
23
|
+
NpFwyRxenk4uZ47SAFZy4Fap1/ECAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8E
|
24
|
+
BAMCBLAwHQYDVR0OBBYEFG72MPsN+YkL6Ia+11qadX+AhO+iMA0GCSqGSIb3DQEB
|
25
|
+
BQUAA4IBAQB+YMhV2RjvM3n+DLVUxfBoBA/UutwbjRk606zMpciyf2vj9TvEKWtn
|
26
|
+
/h9YjenqfpK0DHjWjHQ6OvMXUdW+oWwmge7wj5nzORHvUeYPy8nIL6mgYdB0Ok6l
|
27
|
+
sduNeMJE74Ov5iC/nhNjDJi9f1ALoZ+fnvSoKHeng+h+QLQD0u3Aw0ufd/jOCqPU
|
28
|
+
ElKPfjuyJYok8FN9926m92LoK+jVTi8p88Hnl/r/VjTyxAdE+RtEX+1qmRTurPyq
|
29
|
+
pbz+MRoImeKuDUwGKU4yTar4vTrNQSLtBYqvQkx+so2qfE/pkF4Kl5gSXq25MZAm
|
30
|
+
96nXBrI7LGqIy8FTpiLMU5Ol+URRf94f
|
31
|
+
-----END CERTIFICATE-----
|
32
|
+
|
33
|
+
date: 2009-03-12 00:00:00 -07:00
|
34
|
+
default_executable:
|
35
|
+
dependencies:
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: hoe
|
38
|
+
type: :development
|
39
|
+
version_requirement:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: 1.8.2
|
45
|
+
version:
|
46
|
+
description: "* A command line tool for html tag / css property documentation using htmldog.com as the data source."
|
47
|
+
email:
|
48
|
+
- veganstraightedge@gmail.com
|
49
|
+
executables:
|
50
|
+
- htmldog
|
51
|
+
extensions: []
|
52
|
+
|
53
|
+
extra_rdoc_files:
|
54
|
+
- History.txt
|
55
|
+
- Manifest.txt
|
56
|
+
- README.txt
|
57
|
+
files:
|
58
|
+
- History.txt
|
59
|
+
- Manifest.txt
|
60
|
+
- README.txt
|
61
|
+
- Rakefile
|
62
|
+
- bin/htmldog
|
63
|
+
- lib/htmldog.rb
|
64
|
+
has_rdoc: true
|
65
|
+
homepage: http://theresistancearmy.com/gems/htmldog
|
66
|
+
post_install_message:
|
67
|
+
rdoc_options:
|
68
|
+
- --main
|
69
|
+
- README.txt
|
70
|
+
require_paths:
|
71
|
+
- lib
|
72
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: "0"
|
77
|
+
version:
|
78
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: "0"
|
83
|
+
version:
|
84
|
+
requirements: []
|
85
|
+
|
86
|
+
rubyforge_project: htmldog
|
87
|
+
rubygems_version: 1.3.1
|
88
|
+
signing_key:
|
89
|
+
specification_version: 2
|
90
|
+
summary: "* A command line tool for html tag / css property documentation using htmldog.com as the data source."
|
91
|
+
test_files:
|
92
|
+
- test/test_htmldog.rb
|
metadata.gz.sig
ADDED
Binary file
|