Skip to content

Commit

Permalink
Merge pull request #644 from tripal/fix_PHP_doc_styling
Browse files Browse the repository at this point in the history
remove php tag and fix site build to use php syntax highlighting prop…
  • Loading branch information
laceysanderson committed Sep 13, 2018
2 parents 4b321e6 + 254b9b1 commit bee3e6f
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 26 deletions.
10 changes: 10 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config


#PHP stuff
#see: https://www.sitepoint.com/using-sphinx-for-php-project-documentation/

from sphinx.highlighting import lexers
from pygments.lexers.web import PhpLexer
lexers["php"] = PhpLexer(startinline=True, linenos=1)
lexers["php-annotations"] = PhpLexer(startinline=True, linenos=1)


# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
Expand Down
32 changes: 16 additions & 16 deletions docs/dev_guide/custom_field/manual_field_creation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ The following describes a ChadoField class from top to bottom. The code for the

.. code-block:: php
<?php
class obi__organism extends ChadoField {
Expand All @@ -51,7 +51,7 @@ Next, the TripalField/ChadoField class has a section of public static variables.

.. code-block:: php
<?php
// The default label for this field.
public static $default_label = 'Organism';
Expand All @@ -64,7 +64,7 @@ As described in the section titled Tripal Data Structures, fields that are attac

.. code-block:: php
<?php
// Provide a list of instance specific settings. These can be access within
// the instanceSettingsForm. When the instanceSettingsForm is submitted
// then Drupal with automatically change these settings for the instance.
Expand Down Expand Up @@ -93,7 +93,7 @@ As you may have noticed, a field requires a widget and a formatter. This is why

.. code-block:: php
<?php
// The default widget for this field.
public static $default_widget = 'obi__organism_widget';
Expand All @@ -104,7 +104,7 @@ Drupal allows new instances of fields to be attached to any Bundle. This is rea

.. code-block:: php
<?php
// A boolean specifying that users should not be allowed to create
// fields and instances of this field type through the UI. Such
// fields can only be created programmatically with field_create_field()
Expand All @@ -116,7 +116,7 @@ Sometimes a field is meant to provide a visualization or some other functionalit

.. code-block:: php
<?php
// A boolean specifying that the field will not contain any data. This
// should exclude the field from web serivces or downloads. An example
// could be a quick search field that appears on the page that redirects
Expand All @@ -133,7 +133,7 @@ Finally, the last item in our Class variables is the **download_formatters**. T

.. .. code-block::

<?php

// Indicates the download formats for this field. The list must be the
// name of a child class of the TripalFieldDownloader.
Expand Down Expand Up @@ -237,7 +237,7 @@ We can easily get all of the values we need from this organism object. We can

.. code-block:: php
<?php
$label = tripal_replace_chado_tokens($string, $organism);
$entity->{$field_name}['und'][0]['value'] = array(
Expand Down Expand Up @@ -280,15 +280,15 @@ Notice, though, that we did not add this value inside the 'value' key like we di

.. code-block:: php
<?php
$entity->{$field_name}['und'][0]['value'])
Instead, we put it in at the same level as 'value':

.. code-block:: php
<?php
$entity->{$field_name}['und'][0][$linker_field]
Expand All @@ -314,7 +314,7 @@ The elementInfo() function is necessary to integrate your new field with Drupal

.. code-block:: php
<?php
/**
* @see TripalField::elementInfo()
Expand Down Expand Up @@ -393,7 +393,7 @@ The code above generates and returns an associative array that provides metadata

.. code-block:: php
<?php
$field_term = $this->getFieldTermID();
Expand All @@ -416,7 +416,7 @@ The array keys just mentioned fully describe our field to Drupal and Tripal. Ne

.. code-block:: php
<?php
'elements' => array(
Expand All @@ -434,7 +434,7 @@ Notice that our field will allow searching, provides a variety of search filter

.. code-block:: php
<?php
$genus_term => array(
'searchable' => TRUE,
Expand Down Expand Up @@ -466,7 +466,7 @@ As described above in the elementInfo function section, some fields and elements

.. code-block:: php
<?php
public function query($query, $condition) {
$alias = $this->field['field_name'];
Expand Down Expand Up @@ -517,7 +517,7 @@ The code above is how the field tells Drupal and Tripal how to find and filter t

.. code-block:: php
<?php
$alias = $this->field['field_name'];
$operator = $condition['operator'];
Expand Down
12 changes: 6 additions & 6 deletions docs/dev_guide/custom_field/select_vocab_terms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Notice how the teal box (the **short name**) is OBI, and the orange box contains

.. code-block:: php
<?php
$term= tripal_insert_cvterm([
'id' => 'OBI:0100026',
Expand All @@ -49,7 +49,7 @@ Note that in the code above the namespace is provided as the **cv_name** element

.. code-block:: php
<?php
tripal_insert_db(array(
'name' => 'obi',
'description' => 'The Ontology for Biomedical Investigation.',
Expand All @@ -66,7 +66,7 @@ Second, we insert the record for the controlled vocabulary.

.. code-block:: php
<?php
tripal_insert_cv(
'OBI',
'Ontology for Biomedical Investigation. The Ontology for Biomedical Investigations (OBI) is build in a collaborative, international effort and will serve as a resource for annotating biomedical investigations, including the study design, protocols and instrumentation used, the data generated and the types of analysis performed on the data. This ontology arose from the Functional Genomics Investigation Ontology (FuGO) and will contain both terms that are common to all biomedical investigations, including functional genomics investigations and those that are more domain specific.'
Expand All @@ -86,7 +86,7 @@ Notice that in the Term Info box on the right there is the term **has_obo_namesp

.. code-block:: php
<?php
$term= tripal_insert_cvterm([
'id' => 'SO:0000316',
'name' => 'CDS',
Expand Down Expand Up @@ -117,7 +117,7 @@ For this case, the **namespace** is EDAM, the short name is **data**, and the ac

.. code-block:: php
<?php
$term= tripal_insert_cvterm([
'id' => 'data:2044',
'name' => 'sequence',
Expand Down Expand Up @@ -146,7 +146,7 @@ Sometimes a good CVterm just doesn't exist for what you want to describe. If you

.. code-block:: php
<?php
$term= tripal_insert_cvterm([
'id' => 'local:shame_on_you',
'name' => 'shame_on_you',
Expand Down
8 changes: 4 additions & 4 deletions docs/dev_guide/custom_web_services.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Within this file we will implement our class with the following structure:

.. code-block:: php
<?php
class TripalJobService_v0_1 extends TripalWebService {
/**
Expand Down Expand Up @@ -146,7 +146,7 @@ For our services we need to provide the information to Tripal so that it can gen

.. code-block:: php
<?php
public function getDocumentation() {
$term = tripal_get_term_details('local', 'computational_jobs');
Expand Down Expand Up @@ -219,7 +219,7 @@ in the code above need to determine if the resource is a job collection or a job

.. code-block:: php
<?php
/**
* Generates the job collection resource.
Expand Down Expand Up @@ -294,7 +294,7 @@ Lastly, we need to add our "members" of the collection. These are the jobs from

.. code-block:: php
<?php
foreach ($jobs as $job) {
$member = new TripalWebServiceResource($service_path);
Expand Down

0 comments on commit bee3e6f

Please sign in to comment.