如何在基于 WordPress 的网站中添加和共享源代码文件?
我正在规划一个基于 WordPress 的个人/作品集网站。我想要的是示例 webdev 项目/插件/小部件的列表以及可用于以最不引人注目的方式浏览的源代码(如果可能的话跳过下载、转到另一个站点等)。
替代方案:
最简单的:
- 将代码上传到 github、sourceforge、launchpad、google code 或类似位置。
- 在我的网站的相应部分分享项目源代码的链接。
最简单的:
- 使用现有的 WordPress 插件公开部分上传目录,我可以在其中上传项目的源代码。
- 使用短代码/小部件/自定义页面来显示 WordPress 页面中包含项目和源代码的树视图。
最现实的:
- 从上面编写 WordPress 插件。根据我的初步研究,没有这样的插件可以在 WordPress 网站的用户和/或管理部分公开上传目录文件。
- 根据我最初的想法,该插件基本上是一个文件浏览器,具有精美的树视图和源代码文件内容的视图面板
- (很高兴拥有)AJAX 化插件,可通过语法突出显示查看 DIV 中的源代码内容。
您对此有何看法?
谢谢
I'm planning a personal/portfolio web site based on WordPress. What I would like to have is a list of example webdev projects/plugins/widgets along with the source code available for browsing in the least obtrusive way (if possible to skip downloading, going to another site, etc).
The alternatives:
The simplest:
- Upload the code at github, sourceforge, launchpad, google code, or similar.
- Share the link to the projects source code in the respective section in my site.
The easiest:
- Use an existing WordPress plugin for exposing part of the uploads directory where I can upload the projects' source code.
- Use a shortcode/widget/custom page for displaying the tree view with the projects and the source code within a WordPress page(s).
The most realistic:
- Write the WordPress plugin from above. From my initial research, there is no such plugin for exposing the uploads directory files in the user and/or admin section of a WordPress site.
- From my initial ideas the plugin is basically a file browser with a fancy tree view and a view panel for the source code file contents
- (Nice to have) AJAX-ify the plugin to view the source code contents in a DIV with syntax highlighting.
What's your take on this?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您列出的最简单的选项也可能是最好的。你拥有人们习惯的所有工具——语法着色等——你所要做的就是发表一两条评论,然后链接到它。这可能听起来很愚蠢,但你的代码也有一定的严肃性,因为它不“只是在某些 WordPress 网站上”。
I think what you list as the simplest option is also probably the best. You have all the tools that people are used to -- syntax coloring, etc. -- and all you have to do is make a comment or two and then link to it. This may sound silly, but there is also a certain gravitas lent to your code because it's not "just on some WordPress site".