Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bbbeae6fe9 | |||
| 271c7c619a |
@ -4,12 +4,11 @@ html {
|
|||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
padding:10px;
|
padding: 10px;
|
||||||
padding-top: 0px;
|
padding-top: 0px;
|
||||||
font-family: "Open Sans", sans-serif;
|
font-family: "Open Sans", sans-serif;
|
||||||
background-color: var(--background);
|
background-color: var(--background);
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
color: #333;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
blockquote {
|
blockquote {
|
||||||
|
|||||||
@ -7,7 +7,6 @@ import os.path
|
|||||||
class MLPDevListener(sublime_plugin.EventListener):
|
class MLPDevListener(sublime_plugin.EventListener):
|
||||||
|
|
||||||
def on_post_save(self, view):
|
def on_post_save(self, view):
|
||||||
# return
|
|
||||||
if not (os.path.dirname(__file__) in view.file_name() and
|
if not (os.path.dirname(__file__) in view.file_name() and
|
||||||
view.file_name().endswith('.py')):
|
view.file_name().endswith('.py')):
|
||||||
return
|
return
|
||||||
|
|||||||
@ -29,8 +29,18 @@ def pre_table(s_table):
|
|||||||
text += '|\n'
|
text += '|\n'
|
||||||
|
|
||||||
for j, cell in enumerate(row):
|
for j, cell in enumerate(row):
|
||||||
text += '| ' + ''.join(str(node) for node in cell.contents) \
|
text += '| '
|
||||||
+ ' ' * (cols_width[j] - len(cell.text) + 1)
|
if cell.name == 'th':
|
||||||
|
title = ' ' * ((cols_width[j] - len(cell.text)) // 2) \
|
||||||
|
+ ''.join(str(node) for node in cell.contents) \
|
||||||
|
+ ' ' * int(round((cols_width[j] - len(cell.text)) / 2 ) + 1)
|
||||||
|
# + 1 because of the added space before the closing | of each cell
|
||||||
|
if cols_width[j] + 1 != len(title):
|
||||||
|
title += ' '
|
||||||
|
text += title
|
||||||
|
else:
|
||||||
|
text += ''.join(str(node) for node in cell.contents) \
|
||||||
|
+ ' ' * (cols_width[j] - len(cell.text) + 1)
|
||||||
text += '|\n'
|
text += '|\n'
|
||||||
text += '</pre></code>'
|
text += '</pre></code>'
|
||||||
return text
|
return text
|
||||||
@ -40,7 +50,3 @@ def pre_tables(html):
|
|||||||
for table in soup.find_all('table'):
|
for table in soup.find_all('table'):
|
||||||
table.replace_with(BeautifulSoup(pre_table(table), 'html.parser'))
|
table.replace_with(BeautifulSoup(pre_table(table), 'html.parser'))
|
||||||
return str(soup)
|
return str(soup)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
# CSW: ignore
|
|
||||||
print(pre_tables(html))
|
|
||||||
|
|||||||
@ -8,7 +8,6 @@ if you is moods.curious:
|
|||||||
print('then do it!')
|
print('then do it!')
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
<kbd>ctrl+\`</kbd> or *View → Show Console* and paste `import this`!
|
<kbd>ctrl+\`</kbd> or *View → Show Console* and paste `import this`!
|
||||||
|
|
||||||
> Perfect programmers do NOT need comments.
|
> Perfect programmers do NOT need comments.
|
||||||
@ -27,8 +26,6 @@ if you is moods.curious:
|
|||||||
|
|
||||||
[Sublime Text Logo](https://upload.wikimedia.org/wikipedia/en/4/4c/Sublime_Text_Logo.png)
|
[Sublime Text Logo](https://upload.wikimedia.org/wikipedia/en/4/4c/Sublime_Text_Logo.png)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Some plugin I just *need*:
|
Some plugin I just *need*:
|
||||||
|
|
||||||
- [PackageResourceReviewer](https://packagecontrol.io/packages/PackageResourceViewer)
|
- [PackageResourceReviewer](https://packagecontrol.io/packages/PackageResourceViewer)
|
||||||
|
|||||||
Reference in New Issue
Block a user