Skip to content

zzap/docs_dangit-the-beast

Repository files navigation

docs_dangit: A search engine for WordPress developers

Website: https://docs-dang.it/

CloudFest 2023 Hackathon project

This repo contains the backend code for the project website. Code for the frontend is in docs-dangit repo.

Usage

# Install Composer dependencies
composer install

# Copy and customize the .ini file:
cp config/config.ini.dist config/config.ini

# The parser needs a GitHub access token to be configured on config.ini.

# List valid commands
./bin/docsdangit example

Participants:

Sources

Sources are listed below in the order they have been added to the project.

WordPress code reference

The Code reference handbook is partly generated from the code. Most of the code samples are in the User Contributed Notes section, which are comments (example).

URL: https://developer.wordpress.org/reference/

WP-CLI

We use wp cli cmd-dump to export all commands in a giant JSON file which is stored in the GitHub repo. GitHub action is doing this automatically once a day at 6AM.

URL: https://github.com/wp-cli/handbook/tree/main/commands

PHP code reference

Official PHP documentation, hosted on https://github.com/php/doc-en.

URL: https://www.php.net/docs.php

WordPress dev notes

Every WordPress release is accomanied with a number of dev notes in Core blog. These notes are packed with useful code examples.

URL: https://make.wordpress.org/core/tag/dev-notes/

Technical solution

Backend

Parsers are built on top of Symfony Console component. At the moment of building the tool (CloudFest hackathon 2023), there are four parsers:

Storage is in mySQL with a full-text index and a small API built with Laminas and Mezzio frameworks. API is private for now but could be made public in the future given the proper setup and storage financing is provided.

Data fields

  • Code snippet - the snippet extracted from the source.
  • Context - the whole data chunk, e.g. comment
  • Parse date - the date source was parsed.
  • URL - URL of the source.
  • Code creator - author of the snippet (if available).
  • Code creation datetime - the date of source creation (if available), e.g. comment date.
  • Source - the source of the snippet, e.g. wpcli, wp-reference, wp-reference-comment etc.
  • Version - source version, e.g. WP 6.2, WP-CLI 2.7 etc.
  • Command tags - the command/function found in the snippet, e.g. update_term_meta.
  • Tags - general taxonomy based on various criteria, e.g. WordPress (based on CMS), Laravel (based on the framework) etc.
  • Language - IETF language tag of the source, e.g. en-US.
  • Codelang tags - Tag for the code language, e.g. PHP, JavaScript etc.

Frontend

Frontend is built on React.js with Tailwind CSS.

License

docs_dangit is a free software, and complete code inside it is released under the terms of the GNU General Public License version 3 or later. This does not apply to Google fonts and other 3rd party assets - their original license applies.


by Cloudfest Hackathon Cool Kids

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published