Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WordPress Help #14

Open
raptor235 opened this issue May 10, 2012 · 1 comment
Open

WordPress Help #14

raptor235 opened this issue May 10, 2012 · 1 comment

Comments

@raptor235
Copy link

What would be a plan of attack to get WordPress specific help into the system?

@jlegewie
Copy link
Owner

Can you give some details on a WordPress code file?

Here are more details about adding support to other languages. I will put the same documentation in the main readme.md file.

The key to support other languages is a collection of help files for each function, tag etc. that are either named like the respective function (i.e. one help file for each function) or linked to the function name with a simple json database (e.g. in javascript, length is mapped to Array.length, Function.length, and String.length). The mapping file is called [LANG]-mapping.json and follows this structure

[
  {
      "from": "NaN",
      "to": ["NaN","Number.NaN"]
  },
  {
      "from": "while",
      "to": ["do...while","while"]
  },
  {
      "from": "else",
      "to": "if...else"
  }
]

When multiple help files are linked to one keyword (such as for NaN or while), the user can select between the different alternatives. Note that the mapping file can omit keywords with direct mapping.

For R, I generated these help files with a short script that iterates through all objects in all installed packages and extracts the help file for each function (see the R-help.r file in the help-compiler folder). For HTML, CSS, JavaScript, and PHP, I generate the help files from DocHub using Python (see the GetHelpFiles class in SublimePeek.py).

I third alternative is to generate help files on the fly in Python. Currently, the help for Python and Rubin are create like that using the command line utilities pydoc and ri (see create_help_file function in SublimePeek.py).

If you want to add support for other languages, I am happy to provide further details and make the necessary adjustments to SublimePeek as long as you provide the actual help files with the mapping file.

On May 10, 2012, at 8:56 AM, raptor235 wrote:

What would be a plan of attack to get WordPress specific help into the system?


Reply to this email directly or view it on GitHub:
#14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants