Skip to content

Markdown Neo Edit for Salesforce - A simple markdown and code editor powered by Markdown-it and Ace.

License

Notifications You must be signed in to change notification settings

shellyln/mdne-sf

Repository files navigation

mdne-sf - Markdown Neo Edit for Salesforce

A simple markdown and code editor powered by Markdown-it and Ace.

screenshot

💎 Features

🟢 Salesforce integration features

  • Edit Salesforce record's field.
  • Markdown preview Visualforce example (For embedding in record detail page)

🟢 Editor features

  • Live preview of Markdown, HTML, LSX formats.
  • Export Markdown, HTML, and LSX into HTML.
  • Code highlighting
    • C#
    • CSS
    • Dockerfile
    • Go
    • GraphQL
    • HTML
    • INI
    • Java
    • JavaScript
    • JSON
    • JSON5
    • JSX
    • Kotlin
    • Latex
    • Less
    • Lisp
    • Makefile
    • Markdown
    • Protobuf
    • Python
    • R
    • Ruby
    • Rust
    • Sass
    • Scss
    • Shell script
    • SQL
    • SVG
    • Tex
    • TOML
    • TSX
    • TypeScript
    • XML
    • YAML
  • Markdown extended syntax
    • Many markdown-it plugins are enabled. See here.
  • Scripting and value expansion
  • Full screen mode (F11)

For more informations, see mdne electron repo.

🚚 Distributions and Integrations

  • mdne-sf
    • Edit Salesforce record's field. (browser app)
      • This repository
    • Markdown preview Visualforce page example
  • mdne-electron
    • Standalone offline desktop app for Windows/Mac/Linux.
  • mdne online
    • Online markdown editor for Chrome/Chromium Edge/Firefox.
      • PWA (Progressive Web Apps)
  • mdne (mdne-classic)
    • Offline desktop app for Google Chrome browser + Node.js.
  • mdne-for-kintone
    • Edit kintone record's field. (browser app)

⚙️ Setup a deployment and contribution environment

git clone https://github.com/shellyln/mdne-sf.git
cd mdne-sf
git checkout -b my-package-releases

# Authorize a Dev-Hub org (if you haven't already done).
sfdx force:auth:web:login \
    --setdefaultdevhubusername
    --setalias my-hub-org

sfdx force:org:create \
    --definitionfile config/project-scratch-def.json \
    --setalias MdneSfOrg \
    --durationdays 30 \
    --setdefaultusername
npm install

sfdx force:source:push
sfdx force:org:open

# and try it!

📖 Usage

🟢 Formula field to open the Markdown editor

  1. Click ⚙️Setup menu and click ⚙️Setup.
  2. Open Object Manager and select the object you want to add report. (e.g.: Account)
  3. Select Fields & Relationships menu and click New.
    Item Value
    Object Name Account
    Field Label Open Editor
    Field Name OpenEditor
    API Name OpenEditor__c
    Data Type Formula (Text)
    Formula HYPERLINK("/apex/mdne#open.obj=Account&open.field=Description&open.id=" & Id, "Open Editor", "_blank")
    Blank Field Handling Treat blank fields as blanks
  4. Click Save button.
  5. Select Page Layouts menu and add the field to the layout.

🟢 Show the rendered markdown on the detail view page.

  1. Make a copy Visualforce page MarkdownPreviewExample_Account and edit it.
  2. Click ⚙️Setup menu and click ⚙️Setup.
  3. Open Object Manager and select the object you want to add report. (e.g.: Account)
  4. Select Page Layouts menu and add the copied Visualforce page to the layout.
    Item Value
    Width 100%
    Height 200
    Show scrollbars false
    Show label false

📦 Deploy the package (pre-release)

sfdx force:org:list

# Specify the `USERNAME` or` ALIAS` of the DevHub org listed in the above command.
sfdx force:package:create \
    -n MDNE \
    -d "Report rendering library for Salesforce LWC and Visualforce" \
    -r force-app \
    -t Unlocked \
    -v <devhub_org_username_or_alias>

sfdx force:package:list

cat sfdx-project.json

sfdx force:package:version:create \
    -p MDNE \
    -d force-app \
    -k test1234 \
    -v <devhub_org_username_or_alias> \
    --codecoverage \
    --wait 10

sfdx force:package:version:list --verbose

git add .
git commit -m "v0.1.0-1"

# Install the package in your developer or sandbox org for testing.
sfdx force:package:install \
    -u <target_dev_or_sandbox_org_username_or_alias> \
    --package [email protected] \
    -k test1234 \
    --wait 10 \
    --publishwait 10 \
    --noprompt

🚀 Deploy the package (production-release)

# Promote the package version to production.
sfdx force:package:version:promote \
    -p [email protected] \
    -v <devhub_org_username_or_alias>

# Install the package in your production org.
sfdx force:package:install \
    -u <target_org_username_or_alias> \
    --package [email protected] \
    -k test1234 \
    --wait 10 \
    --publishwait 10 \
    --noprompt

🚧 Manage the package and package versions

sfdx force:package:version:list --verbose
sfdx force:package:version:delete -p 04tXXX
sfdx force:package:delete -p 0HoXXX

License

ISC
Copyright (c) 2020 Shellyl_N and Authors.

Bundled softwares' license

About

Markdown Neo Edit for Salesforce - A simple markdown and code editor powered by Markdown-it and Ace.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published