Skip to content

bigfunctions > markdown2html

markdown2html

Call or Deploy markdown2html ?

✅ You can call this markdown2html bigfunction directly from your Google Cloud Project (no install required).

  • This markdown2html function is deployed in bigfunctions GCP project in 39 datasets for all of the 39 BigQuery regions. You need to use the dataset in the same region as your datasets (otherwise you may have a function not found error).
  • Function is public, so it can be called by anyone. Just copy / paste examples below in your BigQuery console. It just works!
  • You may prefer to deploy the BigFunction in your own project if you want to build and manage your own catalog of functions. This is particularly useful if you want to create private functions (for example calling your internal APIs). Discover the framework

Public BigFunctions Datasets:

Region Dataset
eu bigfunctions.eu
us bigfunctions.us
europe-west1 bigfunctions.europe_west1
asia-east1 bigfunctions.asia_east1
... ...

Description

Signature

markdown2html(markdown)

Description

Convert markdown to html

See the result as a data visualization in BigQuery Console!

The result of this function can be vizualized as an html report directly in BigQuery Console!

  1. Install this bookmarklet: bigfunctions (it has to be done only once)
  2. Open BigQuery console
  3. Click on the installed bookmarklet.
    • From now on, the bookmarklet code will observe the BigQuery console page.
    • If a BigQuery result appears with a unique cell containing html content, it will be rendered.
  4. You will have to click on the bookmarklet again:
    • If you refresh the Bigquery console page,
    • If you open the BigQuery console in a new tab of your browser.
  5. Run the query of the example and open the result of the latest subquery. The result will be shown as a nice html content.


bookmarklet usage

Examples

select bigfunctions.eu.markdown2html('# Title')
select bigfunctions.us.markdown2html('# Title')
select bigfunctions.europe_west1.markdown2html('# Title')
+----------------+
| html           |
+----------------+
| <h1>Title</h1> |
+----------------+

Need help using markdown2html?

The community can help! Engage the conversation on Slack

For professional suppport, don't hesitate to chat with us.

Found a bug using markdown2html?

If the function does not work as expected, please

  • report a bug so that it can be improved.
  • or open the discussion with the community on Slack.

For professional suppport, don't hesitate to chat with us.

Use cases

The markdown2html function is useful anytime you need to convert text formatted in Markdown to HTML within BigQuery. Here are a few use cases:

  • Generating HTML reports directly from BigQuery: Imagine you have data in BigQuery that you want to present in a formatted report. You can use markdown2html to create the HTML structure of the report dynamically, including headings, lists, tables, and formatted text, all within your SQL query. The output can then be visualized directly in the BigQuery console (using the bookmarklet method described in the documentation) or exported for use in other applications.

  • Email formatting: Suppose you are using BigQuery to generate email content. You can store email templates in Markdown format within a BigQuery table. Then, using markdown2html, convert the Markdown to HTML within your query and send the formatted HTML as the body of the email.

  • Dynamic content creation for web applications: If your web application integrates with BigQuery, you might store content in Markdown format in BigQuery. Using markdown2html, you can query the content and convert it to HTML on the fly, reducing the need to store and manage HTML directly. This allows for easier content updates and a more streamlined workflow.

  • Data documentation: You could use Markdown to document your BigQuery datasets and tables. Using markdown2html within a query, you can dynamically generate HTML documentation pages based on the Markdown content, making it easier for users to understand the data.

  • Enriching data exports: If you're exporting data from BigQuery for use in another system that requires HTML formatting, you can use markdown2html to transform any Markdown fields into HTML before export.

In essence, markdown2html bridges the gap between the simplicity of Markdown for writing and editing text, and the richness of HTML for presentation, all within the BigQuery environment.

Spread the word

BigFunctions is fully open-source. Help make it a success by spreading the word!

Share on Add a on