Skip to content

Markdown Converter

This feature enables the conversion of a Markdown file into a rendered HTML or PDF document. The rendered file is stored in the uploaded file storage, and metadata is returned in JSON format.

Configuration

Parameter Description
targetFileName The desired name of the output file (e.g., MyDocument.pdf or MyDocument.html).
sourceFileId The ID of the Markdown file to render. Note: the file is non-versioned.
targetType The output format: either HTML or PDF.
htmlHeadDefinition Optional - Custom CSS styles to apply during rendering. This is provided as raw CSS and applies to both HTML and PDF outputs. See example below.

Notes:

  • Any image references in the Markdown file must be publicly accessible to appear correctly in the output.

  • At this time, Japanese characters and other languages requiring special fonts are not supported.

Using the Markdown Converter Script Activity

To use the Markdown Converter script effectively in a process, follow these steps:

  1. Add a New Activity

    • Insert a new activity into your process model where the Markdown conversion should occur.
  2. Select Script Type

    • Choose Script as the activity type from the configuration panel.
  3. Enter File Name

    • Provide the name for the output file, including the appropriate extension (e.g., document.pdf or document.html).
  4. Specify File ID

    • Enter the ID of the source Markdown file. This should refer to a previously uploaded file.
  5. Choose Target Type (HTML or PDF)

    Select the desired output format:

    • HTML to convert the Markdown to an HTML file.
    • PDF to generate a PDF document from the Markdown content.
  6. Add Optional HTML/CSS Styling

    • If needed, include custom HTML headers or CSS styles to enhance the output formatting. This step is optional but useful for advanced styling.
  7. Save Changes

    • Click Save to apply the activity configuration to the process.
  8. Test and Verify Output File

    • Execute the process to test the Markdown conversion. Check the resulting file to ensure it matches the expected content and formatting.

Output

On success, the renderer returns a JSON object with metadata about the generated file.

Example response (P_result):

{
  "created": "2025-07-15",
  "customer": 2214606112,
  "id": "216ddff6-9e9d-46a2-a446-39355a03b98c",
  "name": "TestWithCSS.pdf",
  "size": 5047,
  "type": "application/pdf",
  "updated": "2025-07-15",
  "url": "https://beta-live.runmyprocess.com/live/2214606112/upload/216ddff6-9e9d-46a2-a446-39355a03b98c",
  "visibility": "PRIVATE"
}

The rendered file can be accessed via the provided url and is stored in the uploaded file storage.

Example CSS Head Definition

When specifying a custom style, pass only the CSS content (without <style> tags). Below is an example of CSS you can use:

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #222;
  background-color: #fff;
  line-height: 1.6;
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
}

h1 {
  font-size: 2em;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  border-bottom: 2px solid #ccc;
  padding-bottom: 0.3em;
}

h2 {
  font-size: 1.5em;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  border-bottom: 1px solid #ddd;
}

h3 {
  font-size: 1.25em;
  margin-top: 1.2em;
  margin-bottom: 0.3em;
}

p {
  margin-bottom: 1em;
}

a {
  color: #0366d6;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

ul, ol {
  margin-left: 1.5em;
  margin-bottom: 1em;
}

li {
  margin-bottom: 0.3em;
}

pre {
  background: #f6f8fa;
  padding: 1em;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.9em;
}

code {
  background: #f6f8fa;
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}

blockquote {
  margin: 1em 0;
  padding: 0.6em 1em;
  background-color: #f9f9f9;
  border-left: 4px solid #ccc;
  color: #555;
}

hr {
  border: none;
  border-top: 1px solid #eee;
  margin: 2em 0;
}

Paste this CSS as the value of the htmlHeadDefinition parameter if desired.

Summary of Limitations

  • Only supports Markdown files as source.
  • Only outputs to HTML or PDF.
  • Images must be publicly accessible URLs.
  • No support for Japanese or other special-font languages yet.