maluen / code-medium Goto Github PK
View Code? Open in Web Editor NEWBrowser extension that simplifies writing code in Medium posts. Quickly create and edit Github Gists without leaving the editor
License: Mozilla Public License 2.0
Browser extension that simplifies writing code in Medium posts. Quickly create and edit Github Gists without leaving the editor
License: Mozilla Public License 2.0
The extension is great for doing code blocks in Medium. Any thoughts on supporting Substack, or do you know a similar solution to substack?
First of all, thanks for an amazing extension!
I often find it useful to be able to see the article I'm editing while creating the gist. Currently, the popup is positioned in the middle of the screen and overlays the majority of the content. There could be an option to move the popup in the empty area of the page (to the left or to the right of the content) and make sure that the content of the article is still selectable. This way I'd be able to copy-paste things from the article into the gist.
I have been using Code-Medium for a while (thanks for a great tool!).
Recently, modifying a gist stopped working properly.
When I double click an existing gist when editing my story, the code-medium interface appears but completely empty.
The "View on Github" button still works, though.
I get the following error:
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'content')
at App.js:2:2522360
The json object of the gist being retrieved:
{
"url": "https://api.github.com/gists/b85b9abae5c2efea5835addfcb827f67",
"forks_url": "https://api.github.com/gists/b85b9abae5c2efea5835addfcb827f67/forks",
"commits_url": "https://api.github.com/gists/b85b9abae5c2efea5835addfcb827f67/commits",
"id": "b85b9abae5c2efea5835addfcb827f67",
"node_id": "G_kwDOAAPQAdoAIGI4NWI5YWJhZTVjMmVmZWE1ODM1YWRkZmNiODI3ZjY3",
"git_pull_url": "https://gist.github.com/b85b9abae5c2efea5835addfcb827f67.git",
"git_push_url": "https://gist.github.com/b85b9abae5c2efea5835addfcb827f67.git",
"html_url": "https://gist.github.com/b85b9abae5c2efea5835addfcb827f67",
"files": {
"mocking-with-mockk.kt": {
"filename": "mocking-with-mockk.kt",
"type": "text/plain",
"language": "Kotlin",
"raw_url": "https://gist.githubusercontent.com/SalomonBrys/b85b9abae5c2efea5835addfcb827f67/raw/00c6dae9c142f190c1b7b846e6a43e3bf6ac883f/mocking-with-mockk.kt",
"size": 128,
"truncated": false,
"content": "val repo = mockk<Repository>()\nevery { repo.getUser(id = any()) } returns fakeUser()\n\nassertEquals(fakeUser(), repo.getUser(42))"
}
},
"public": false,
"created_at": "2022-01-10T18:42:00Z",
"updated_at": "2022-01-10T18:51:14Z",
"description": "",
"comments": 0,
"user": null,
"comments_url": "https://api.github.com/gists/b85b9abae5c2efea5835addfcb827f67/comments",
"owner": {
"login": "SalomonBrys",
"id": 249857,
"node_id": "MDQ6VXNlcjI0OTg1Nw==",
"avatar_url": "https://avatars.githubusercontent.com/u/249857?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/SalomonBrys",
"html_url": "https://github.com/SalomonBrys",
"followers_url": "https://api.github.com/users/SalomonBrys/followers",
"following_url": "https://api.github.com/users/SalomonBrys/following{/other_user}",
"gists_url": "https://api.github.com/users/SalomonBrys/gists{/gist_id}",
"starred_url": "https://api.github.com/users/SalomonBrys/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/SalomonBrys/subscriptions",
"organizations_url": "https://api.github.com/users/SalomonBrys/orgs",
"repos_url": "https://api.github.com/users/SalomonBrys/repos",
"events_url": "https://api.github.com/users/SalomonBrys/events{/privacy}",
"received_events_url": "https://api.github.com/users/SalomonBrys/received_events",
"type": "User",
"site_admin": false
},
"forks": [],
"history": [
{
"user": {
"login": "SalomonBrys",
"id": 249857,
"node_id": "MDQ6VXNlcjI0OTg1Nw==",
"avatar_url": "https://avatars.githubusercontent.com/u/249857?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/SalomonBrys",
"html_url": "https://github.com/SalomonBrys",
"followers_url": "https://api.github.com/users/SalomonBrys/followers",
"following_url": "https://api.github.com/users/SalomonBrys/following{/other_user}",
"gists_url": "https://api.github.com/users/SalomonBrys/gists{/gist_id}",
"starred_url": "https://api.github.com/users/SalomonBrys/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/SalomonBrys/subscriptions",
"organizations_url": "https://api.github.com/users/SalomonBrys/orgs",
"repos_url": "https://api.github.com/users/SalomonBrys/repos",
"events_url": "https://api.github.com/users/SalomonBrys/events{/privacy}",
"received_events_url": "https://api.github.com/users/SalomonBrys/received_events",
"type": "User",
"site_admin": false
},
"version": "bd383f0b464434ea01e90785fc24e420775da5d0",
"committed_at": "2022-01-10T18:51:14Z",
"change_status": {
"total": 4,
"additions": 3,
"deletions": 1
},
"url": "https://api.github.com/gists/b85b9abae5c2efea5835addfcb827f67/bd383f0b464434ea01e90785fc24e420775da5d0"
},
{
"user": {
"login": "SalomonBrys",
"id": 249857,
"node_id": "MDQ6VXNlcjI0OTg1Nw==",
"avatar_url": "https://avatars.githubusercontent.com/u/249857?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/SalomonBrys",
"html_url": "https://github.com/SalomonBrys",
"followers_url": "https://api.github.com/users/SalomonBrys/followers",
"following_url": "https://api.github.com/users/SalomonBrys/following{/other_user}",
"gists_url": "https://api.github.com/users/SalomonBrys/gists{/gist_id}",
"starred_url": "https://api.github.com/users/SalomonBrys/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/SalomonBrys/subscriptions",
"organizations_url": "https://api.github.com/users/SalomonBrys/orgs",
"repos_url": "https://api.github.com/users/SalomonBrys/repos",
"events_url": "https://api.github.com/users/SalomonBrys/events{/privacy}",
"received_events_url": "https://api.github.com/users/SalomonBrys/received_events",
"type": "User",
"site_admin": false
},
"version": "a032c65d2abe1a0d007192d396c2cf018c6a88bf",
"committed_at": "2022-01-10T18:46:51Z",
"change_status": {
"total": 2,
"additions": 1,
"deletions": 1
},
"url": "https://api.github.com/gists/b85b9abae5c2efea5835addfcb827f67/a032c65d2abe1a0d007192d396c2cf018c6a88bf"
},
{
"user": {
"login": "SalomonBrys",
"id": 249857,
"node_id": "MDQ6VXNlcjI0OTg1Nw==",
"avatar_url": "https://avatars.githubusercontent.com/u/249857?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/SalomonBrys",
"html_url": "https://github.com/SalomonBrys",
"followers_url": "https://api.github.com/users/SalomonBrys/followers",
"following_url": "https://api.github.com/users/SalomonBrys/following{/other_user}",
"gists_url": "https://api.github.com/users/SalomonBrys/gists{/gist_id}",
"starred_url": "https://api.github.com/users/SalomonBrys/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/SalomonBrys/subscriptions",
"organizations_url": "https://api.github.com/users/SalomonBrys/orgs",
"repos_url": "https://api.github.com/users/SalomonBrys/repos",
"events_url": "https://api.github.com/users/SalomonBrys/events{/privacy}",
"received_events_url": "https://api.github.com/users/SalomonBrys/received_events",
"type": "User",
"site_admin": false
},
"version": "de330dc4602a34cef88176cc8a37a5b4060e034a",
"committed_at": "2022-01-10T18:42:00Z",
"change_status": {
"total": 2,
"additions": 2,
"deletions": 0
},
"url": "https://api.github.com/gists/b85b9abae5c2efea5835addfcb827f67/de330dc4602a34cef88176cc8a37a5b4060e034a"
}
],
"truncated": false
}
Great plugin, thanks!
It would be quite neat if when editing a Gist, pressing Ctrl + S "saved" the Gist (effectively simulating the "update gist" button).
Medium itself does this when writing an article (pressing Ctrl + S will "save" the article").
Thanks!
Hello, since a few weeks I'm not able to use the extension withing Medium. The icon to add the codes doesn't appears. How can I fix this problem? Thanks.
Extension doesn't work. No any action after clicking on the extension's icon. No errors in the console. Extension is activated, link "options" is deactivated.
Chrome 97.0.4692.71 x64
This extension is exactly what I was looking for! Thanks for doing this. I was wondering if we can assign shortcut keys to insert Github Gists using this extension? Medium already has some for text (e.g., CMD+OPTION+1 => Heading 1). It'd be nice to have something like CMD+OPT+0 => Insert Gist.
When I install the extension and click "GitHub login" a popup window appears asking for GitHub credentials. The popup window doesn't have an addressbar, F11 (page inspect) doesn't work. How can I know it's real, not phished GitHub login window?
And also: IMHO this windows shouldn't even appear at all, I'm already logged in to GitHub, the extension could simply use cookie.
Browser: Chrome
OS: Kubuntu 20
The extension should be ported from current MV2 to MV3. Deadline is January 2023, after which Chrome will stop running MV2 extensions, or at least prevent new installations and updates.
See https://developer.chrome.com/docs/extensions/mv3/intro/
The current chrome MV3 implementation is still bugged in some areas and some other APIs might change, so it's probably better to hold off on publishing until things are more stable. Work and testing can be done on a separate branch for now.
Today i see my published article and the code gist i add change into html format code i dont know what is happening please fix it
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.