Skip to content

PLMarkdown is a PL/SQL Object Type to create simple Markdown text and/or file.

License

Notifications You must be signed in to change notification settings

teotiger/plmarkdown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PLMarkdown

Introduction

PLMarkdown is a PL/SQL Object Type to create simple Markdown text and/or file. For more information on Markdown see http://daringfireball.net/projects/markdown

Installation

Simply run the install script from the setup folder inside SQL*Plus.

Usage

First of all you have to declare and initialize a variable. In the block below, you declare object l_md of type PLMarkdown. Then, you call the constructor for object type PLMarkdown to initialize the object. The call assign the values TRUE and TRUE to the attributes prn and toc inside the object. With prn you can set if you want to read your input to the object in DBMS_OUTPUT (default is FALSE). With toc you set whether a table of content at the beginning of the document is generated from all headers (default is FALSE).

DECLARE
   l_md PLMarkdown;
BEGIN
   l_md := PLMarkdown(TRUE, TRUE);
   ...

PLMarkdown procedures/functions

  • p(p_val VARCHAR2)
    A normal paragraph. You can write inside the paragraph a specific markup like ** for bold, * for italic or [link](https://github.com/) for a link as well as valid html code like <hr>.
  • h1(p_val VARCHAR2), h2(p_val VARCHAR2), h3(p_val VARCHAR2), h4(p_val VARCHAR2), h5(p_val VARCHAR2) and h6(p_val VARCHAR2)
    A header text.
  • b(p_val VARCHAR2)
    A blockquote.
  • ul(p_val VARCHAR2, p_idx SIMPLE_INTEGER DEFAULT 1)
    An unordered list.
  • ol(p_val VARCHAR2, p_idx SIMPLE_INTEGER DEFAULT 1)
    An ordered list.
  • img(p_lnk VARCHAR2, p_val VARCHAR2 DEFAULT NULL)
    An image, the title on mouseover is optional.
  • c(p_val VARCHAR2)
    A code block.

Special procedures/functions

  • lorem(p_words SIMPLE_INTEGER)
    Adds a specific number of words (max 149) from the lorem ipsum text.
  • get RETURN CLOB
    Returns all content from the object.
  • save(p_loc VARCHAR2, p_file VARCHAR2)
    Writes the content to a filename in a specified location.
  • sql2table(p_sql_statement VARCHAR2, p_null_display VARCHAR2 DEFAULT '--', p_date_format VARCHAR2 DEFAULT 'dd.mm.yyyy', p_number_format VARCHAR2 DEFAULT 'FM9G999G999G999G990D00')
    Convert a sql statement to a table.
  • sql2chart(p_sql_statement VARCHAR2, p_chart_type VARCHAR2, p_show_legend BOOLEAN DEFAULT FALSE, p_image_type VARCHAR2 DEFAULT 'png')
    Convert a sql statement to a chart.
    Notes: Valid chart types are 'pie', 'bar', 'line' and 'area', valid image types 'png' and 'svg'. For more information see plmarkdown_hr_schema.md in the demo section or visit the website from chartspree.io.

HTML Output

The markdown generated by PLMarkdown can be converted using a PL/SQL packge from here.

License

PLMarkdown is released under the MIT license.

Version History

Version 1.3 - July 7, 2016

  • sql2chart added

Version 1.2 - June 13, 2016

  • Small functional enhancements

Version 1.1 - March 8, 2016

  • sql2table added

Version 1.0 - February 10, 2016

  • Initial release

About

PLMarkdown is a PL/SQL Object Type to create simple Markdown text and/or file.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages