Conversation
1. Define column size 2. Define row size 3. Define align type (left, right or center) 4. Define headers
1d278b8 to
ccabdb5
Compare
markdown-mode.el
Outdated
| (define-key map (kbd "C-c C-t s") 'markdown-insert-header-setext-2) | ||
| (define-key map (kbd "C-c C-t t") 'markdown-insert-header-setext-1) | ||
| (define-key map (kbd "C-c C-i") 'markdown-insert-image) | ||
| (define-key map (kbd "C-c C-t") 'markdown-insert-table) |
There was a problem hiding this comment.
C-c C-t is actually a prefix to heading (titling) commands (which can be seen a couple of lines above). We'd need to find a new keybinding. Perhaps C-c C-s t, which would be under markdown-mode-style-map.
markdown-mode.el
Outdated
| ["Insert Column" markdown-table-insert-column | ||
| :enable (markdown-table-at-point-p)] | ||
| ["Insert Table" markdown-insert-table | ||
| :enable (markdown-table-at-point-p)] |
There was a problem hiding this comment.
I think the predicate should be(not (markdown-table-at-point-p)), which means this menu item is only enabled when there is not a table at the point.
markdown-mode.el
Outdated
| (cond ((equal align-type "left") (setq content ":---")) | ||
| ((equal align-type "right") (setq content "---:")) | ||
| ((equal align-type "center") (setq content "---")) | ||
| (t (user-error "Speficy align-type: left, right or center"))) |
There was a problem hiding this comment.
Perhaps centered should be the pass-through default?
markdown-mode.el
Outdated
| (interactive) | ||
| (let ((table-column (string-to-number (read-string "column size: "))) | ||
| (table-row (string-to-number (read-string "row size: "))) | ||
| (align-type (read-string "align type: ")) |
There was a problem hiding this comment.
Maybe a helpful tip in the prompt such as "(left, right, center (default)):"
README.md
Outdated
| correctly when calculating column widths, however, columns | ||
| containing hidden markup may not always be aligned properly. | ||
|
|
||
| <kbd>C-c C-t</kbd> (`markdown-insert-table`) is a general command for |
There was a problem hiding this comment.
Thanks for updating the docs. Please update this line with the new keybinding (see below).
README.md
Outdated
| - Specify row size. | ||
| - Specify column size. | ||
| - Specify table align: right, left or center. | ||
| - Specify header contetnts. |
- Change keybinding from `C-c C-t` to `C-c C-s t`. - Fix typo in README. - Delete markdown-insert-table's enable condition in markdown-mode-menu. - Set center align as default and fix test codes.
|
@jrblevin Thank you for your comments. I fixed some codes following your comments. |
|
Thanks for updating. I applied this as 5252b71 with a couple of additional minor changes: I removed the duplicate keybinding (it's only needed in the style keymap under |
Description
Related Issue
Nothing.
Type of Change
Checklist
make test).