Skip to content

Commit

Permalink
Merge pull request #1 from afazio1/dev
Browse files Browse the repository at this point in the history
use sentence case and fix command name
  • Loading branch information
afazio1 authored Jun 6, 2023
2 parents dc38c9e + 68075ac commit 551a706
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,26 @@ Get the benefits of composing markdown notes in Obsidian without having to manua
After enabling the plugin, go to Markdown Blogger's settings.
- Set the **Local Project Folder Path**. Must be an **absolute** path.

### Push Markdown command
### Push markdown command
Creates or overwrites a file at location `/PROJECT_PATH/<note_name>.md` with the current note's markdown content.
- Open a markdown note in editing mode
- Open the command palette and search "Push Markdown command"
- If the **Local Project Folder Path** is invalid or does not exist, the note will not be pushed

### Pull Markdown command
### Pull markdown command
Overwrites the current note's markdown content with the file content at location `/PROJECT_PATH/<note_name>.md`
- Open a markdown note in editing mode
- Open the command palette and search "Pull Markdown command"
- If the file at location `/PROJECT_PATH/<note_name>.md` is invalid or does not exist, the content will not be pulled

### Validate Path command
Validates the **Local Project Folder Path** currently in settings.
### Validate path command
Validates the **Local project folder path** currently in settings.
- Open the command palette and search "Validate Path command"
- A message indicating the validity of the path will be displayed

## Tips & Disclaimers
1. This is not a Version Control System like Git. Push and pull commands will overwrite the contents of the file. No history is tracked. I recommend only making changes to one file at any given time and pushing or pulling before editing a file.
2. Triple-check your **Local Project Folder Path**. You can easily copy the **absolute** path from within VS Code by right-clicking the directory where you store your `.md` files.
2. Triple-check your **Local project folder path**. You can easily copy the **absolute** path from within VS Code by right-clicking the directory where you store your `.md` files.
- Ex. `/Users/alexa/Desktop/code-projects/alexa-blog/src/content`
3. Files are paired with each other (in Obsidian vs. in Project) based on their filename. As of now, if you change the filename in one place you must change it in the other.
4. Since the `.md` file in your project will have the same filename as the Obsidian note it was generated from, I recommend using hyphens instead of spaces when naming files.
Expand Down
16 changes: 8 additions & 8 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ export default class MarkdownBlogger extends Plugin {
await this.loadSettings();

this.addCommand({
id: 'validate-path-command',
name: 'Validate Path command',
id: 'validate-path',
name: 'Validate path',
editorCallback: (editor: Editor, view: MarkdownView) => {

const { projectFolder } = this.settings;
Expand All @@ -32,8 +32,8 @@ export default class MarkdownBlogger extends Plugin {
});

this.addCommand({
id: 'push-md-command',
name: 'Push Markdown command',
id: 'push-md',
name: 'Push markdown',
editorCallback: (editor: Editor, view: MarkdownView) => {

const { projectFolder } = this.settings;
Expand All @@ -53,8 +53,8 @@ export default class MarkdownBlogger extends Plugin {
});

this.addCommand({
id: 'pull-md-command',
name: 'Pull Markdown command',
id: 'pull-md',
name: 'Pull markdown',
editorCheckCallback: (checking: boolean, editor: Editor, view: MarkdownView) => {
const projectBlogPath = path.resolve(this.settings.projectFolder, view.file.name);

Expand Down Expand Up @@ -97,7 +97,7 @@ class ErrorModal extends Modal {

onOpen() {
const {contentEl} = this;
contentEl.setText("The project folder does not exist. Please create the path or update the current path in Plugin Settings.");
contentEl.setText("The project folder does not exist. Please create the path or update the current path in plugin settings.");
}

onClose() {
Expand All @@ -122,7 +122,7 @@ class MarkdownBloggerSettingTab extends PluginSettingTab {
containerEl.createEl('h2', {text: 'Settings for Obsidian Markdown Blogger.'});

new Setting(containerEl)
.setName('Local Project Folder Path')
.setName('Local project folder path')
.setDesc('The local project folder for your blog, portfolio, or static site. Must be an absolute path.')
.addText(text => text
.setPlaceholder('/Users/johnsample/projects/astro-blog/collections/')
Expand Down

0 comments on commit 551a706

Please sign in to comment.