[Groonga-commit] groonga/groonga at d3eee72 [master] doc en: add html_untag documentation

Back to archive index

HAYASHI Kentaro null+****@clear*****
Thu Jun 27 15:12:05 JST 2013


HAYASHI Kentaro	2013-06-27 15:12:05 +0900 (Thu, 27 Jun 2013)

  New Revision: d3eee72e3d0b3c4a5f6e3c33b45c1ddcbd1622f7
  https://github.com/groonga/groonga/commit/d3eee72e3d0b3c4a5f6e3c33b45c1ddcbd1622f7

  Message:
    doc en: add html_untag documentation

  Added files:
    doc/source/example/reference/functions/html_untag/usage_html_untag.log
    doc/source/example/reference/functions/html_untag/usage_setup_data.log
    doc/source/example/reference/functions/html_untag/usage_setup_schema.log
    doc/source/reference/functions/html_untag.txt

  Added: doc/source/example/reference/functions/html_untag/usage_html_untag.log (+29 -0) 100644
===================================================================
--- /dev/null
+++ doc/source/example/reference/functions/html_untag/usage_html_untag.log    2013-06-27 15:12:05 +0900 (dafa1a4)
@@ -0,0 +1,29 @@
+Execution example::
+
+  select WebClips --output_columns "_key, html_untag(content)" --command_version 2
+  # [
+  #   [
+  #     0, 
+  #     1337566253.89858, 
+  #     0.000355720520019531
+  #   ], 
+  #   [
+  #     [
+  #       [
+  #         2
+  #       ], 
+  #       [
+  #         [
+  #           "html_untag", 
+  #           "null"
+  #         ]
+  #       ], 
+  #       [
+  #         "groonga is fast"
+  #       ], 
+  #       [
+  #         "mroonga is fast"
+  #       ]
+  #     ]
+  #   ]
+  # ]

  Added: doc/source/example/reference/functions/html_untag/usage_setup_data.log (+8 -0) 100644
===================================================================
--- /dev/null
+++ doc/source/example/reference/functions/html_untag/usage_setup_data.log    2013-06-27 15:12:05 +0900 (3f8fc4c)
@@ -0,0 +1,8 @@
+Execution example::
+
+  load --table WebClips
+  [
+  {"_key": 1, "url": "http://groonga.org", "tag": ["groonga"], "content": "groonga is <span class='emphasize'>fast</span>"},
+  {"_key": 2, "url": "http://mroonga.org", "tag": ["mroonga"], "content": "mroonga is <span class=\"emphasize\">fast</span>"},
+  ]
+  # [[0, 1337566253.89858, 0.000355720520019531], 2]

  Added: doc/source/example/reference/functions/html_untag/usage_setup_schema.log (+10 -0) 100644
===================================================================
--- /dev/null
+++ doc/source/example/reference/functions/html_untag/usage_setup_schema.log    2013-06-27 15:12:05 +0900 (e909db9)
@@ -0,0 +1,10 @@
+Execution example::
+
+  table_create WebClips TABLE_NO_KEY
+  # [[0, 1337566253.89858, 0.000355720520019531], true]
+  column_create WebClips url COLUMN_SCALAR ShortText
+  # [[0, 1337566253.89858, 0.000355720520019531], true]
+  column_create WebClips content COLUMN_SCALAR ShortText
+  # [[0, 1337566253.89858, 0.000355720520019531], true]
+  column_create WebClips tag COLUMN_VECTOR ShortText
+  # [[0, 1337566253.89858, 0.000355720520019531], true]

  Added: doc/source/reference/functions/html_untag.txt (+75 -0) 100644
===================================================================
--- /dev/null
+++ doc/source/reference/functions/html_untag.txt    2013-06-27 15:12:05 +0900 (5c62d4a)
@@ -0,0 +1,75 @@
+.. -*- rst -*-
+
+.. highlightlang:: none
+
+.. groonga-command
+.. database: functions_html_untag
+
+html_untag
+==========
+
+Summary
+-------
+
+``html_untag`` strips HTML tags from HTML and outputs plain text.
+
+``html_untag`` is used in ``--output_columns`` described at :doc:`/reference/commands/select`.
+
+Syntax
+------
+
+``html_untag`` requires only one argument. It is ``column``.
+
+::
+
+  html_untag(column)
+
+
+Usage
+-----
+
+Here are a schema definition and sample data to show usage.
+
+Sample schema:
+
+.. groonga-command
+.. include:: ../../example/reference/functions/html_untag/usage_setup_schema.log
+.. table_create WebClips TABLE_NO_KEY
+.. column_create WebClips url COLUMN_SCALAR ShortText
+.. column_create WebClips content COLUMN_SCALAR ShortText
+.. column_create WebClips tag COLUMN_VECTOR ShortText
+
+Sample data:
+
+.. groonga-command
+.. include:: ../../example/reference/functions/html_untag/usage_setup_data.log
+.. load --table WebClips
+.. [
+.. {"_key": 1, "url": "http://groonga.org", "tag": ["groonga"], "content": "groonga is <span class='emphasize'>fast</span>"},
+.. {"_key": 2, "url": "http://mroonga.org", "tag": ["mroonga"], "content": "mroonga is <span class=\"emphasize\">fast</span>"},
+.. ]
+
+Here is the simple usage of ``html_untag`` function which strips HTML tags from content of column.
+
+.. groonga-command
+.. include:: ../../example/reference/functions/html_untag/usage_html_untag.log
+.. select WebClips --output_columns "_key, html_untag(content)" --command_version 2
+
+When executing the above query, you can see "span" tag with "class" attribute is stripped.
+Note that you must specify ``--command_version 2`` to use ``html_untag`` function.
+
+Parameters
+----------
+
+There is one required parameter, ``column``.
+
+``column``
+^^^^^^^^^
+
+It specifies a column of the table.
+
+Return value
+------------
+
+``html_untag`` returns plain text which is stripped HTML tags from content of column.
+
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index