Skip to content

Commit

Permalink
Update documentation files (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
janette committed Apr 5, 2023
1 parent 77f24cb commit 104562e
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 58 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

## What is dkan-ddev-addon?

DKAN DDev Addon provides some glue scripts and config for doing local development of
DKAN itself and also DKAN-related Drupal sites.
DKAN DDev Add-on provides commands and config for development of
DKAN itself and DKAN-enabled Drupal sites in a local docker environment.

## Documentation

Expand Down
2 changes: 0 additions & 2 deletions commands/host/dkan-init
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ if [ $INIT_MODULEDEV = true ]; then
ddev composer require getdkan/dkan:@dev --no-install
fi

# TODO: Change this after https://www.drupal.org/project/moderated_content_bulk_publish/issues/3301389
ddev composer require drupal/pathauto:^1.10 --no-install
ddev composer install

# Adjust settings for our special case.
Expand Down
32 changes: 5 additions & 27 deletions commands/web/dkan-frontend-install
Original file line number Diff line number Diff line change
@@ -1,41 +1,20 @@
#!/bin/bash
#ddev-generated

## Description: Add the frontend for DKAN.
## Description: Add the decoupled frontend for DKAN.
## Usage: dkan-frontend-install
## Flags: [{"Name":"theme", "Usage":"Whether or not to install default front-end Drupal theme. 0 or 1.", "DefValue": "1"}]
## Example: "ddev dkan-frontend-install" (will install default frontend theme by default), "ddev dkan-frontend-install --theme 0"

# TODO: Make a CI flag.

# Glean flag arguments.
FRONTEND_THEME_INSTALL=1
while :; do
case ${1:-} in
--theme)
shift
FRONTEND_THEME_INSTALL=${1:-}
;;
--) # End of all options.
break
;;
-?*)
printf 'WARN: Unknown option (ignored): %s\n' "$1" >&2
;;
*) # Default case: No more options, so break out of the loop.
break ;;
esac
shift
done

FRONTEND_TMP='src/tmp'
FRONTEND_DOCROOT_DIR='docroot/frontend'
FRONTEND_VCS_URL='https://github.com/GetDKAN/data-catalog-app/'
# TODO: no-node-sass is the known-good branch, so we should move that forward to be a release.
#FRONTEND_VCS_REF='cypress-update-8.7.0'
#FRONTEND_VCS_REF='1.0.4'
FRONTEND_VCS_REF='no-node-sass'
FRONTEND_THEME='dkan_js_frontend_bartik'

if [[ -L $FRONTEND_DOCROOT_DIR ]]; then
echo "ERROR: Symlink $FRONTEND_DOCROOT_DIR already exists."
Expand All @@ -55,11 +34,6 @@ if [ ! -z "$DKAN_MODULE_PATH" ]; then
fi
fi

# TODO: We're hardcoding this VCS ref because dkan module's configured one breaks the build.
FRONTEND_VCS_URL='https://github.com/GetDKAN/data-catalog-app/'
FRONTEND_VCS_REF='no-node-sass'


drush pm-enable dkan_js_frontend -y
drush config-set system.site page.front '/home' -y
drush cr
Expand All @@ -76,4 +50,8 @@ cd $FRONTEND_DOCROOT_DIR || exit
# TODO: Make sure we don't miss important warnings.
npm --loglevel=error install

drush pm-enable dkan_js_frontend -y
drush config-set system.site page.front '/home' -y
drush cr

echo " ** Frontend install complete."
2 changes: 1 addition & 1 deletion docs/frontend.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Frontend Application Management

DKAN includes a front-end application to display and query data.
DKAN includes a decoupled front-end application to display and query data.

This front end can be managed using the following tools:

Expand Down
72 changes: 46 additions & 26 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,32 @@

## Start a new DKAN site

First, set up your DKAN site:
First, make a directory for your project.

mkdir my-project && cd my-project

Give DDev just enough configuration to get started.

# Make a directory for your project.
mkdir my-project && cd my_project
# Give DDev just enough configuration to get started.
ddev config --auto
# Grab the addon so you get the fun stuff.
# Note that eventually we'll be 'official' and you won't have
# to install this from a tarball.

Grab the DKAN addon to get helpful DKAN commands.
Note that eventually we'll be 'official' and you won't have
to install this from a tarball.

ddev get https://github.com/GetDKAN/dkan-ddev-addon/archive/refs/heads/main.tar.gz
# Make sure we're using the addon.

Make sure we're using the addon.

ddev restart
# Initialize the site.

Initialize the site.

ddev dkan-init
# This will ask you if it's OK to remove most of the files in your project.
# You can answer yes since there's nothing there right now anyway.
# Now install Drupal.

This will ask you if it's OK to remove most of the files in your project.
You can answer yes since there's nothing there right now anyway.
Now install Drupal.

ddev dkan-site-install

Now we have a useful DKAN-based Drupal site, so let's take a look, and use the
Expand All @@ -31,29 +40,35 @@ standard tools to log in:
Note that if you need help with any of the DDev commands, you can add `--help`
on the command line and get help:

% ddev dkan-init --help
ddev dkan-init --help
Build the Drupal codebase for a DKAN site. (shell host container command)

Usage:
ddev dkan-init [flags]
ddev dkan-init [flags]

Examples:
dkan-init
dkan-init --project-version 10.0.x-dev

Flags:
--force Force init even if there are files present which could be deleted.
-h, --help help for dkan-init
--moduledev Set up the file system for DKAN module development.
--force Force init even if there are files present which could be deleted.
-h, --help help for dkan-init
--moduledev Set up the file system for DKAN module development.
--project-version Specify a Drupal core version. Default 9.5.x-dev.

Global Flags:
-j, --json-output If true, user-oriented output will be in JSON format.

## Dev work on the DKAN module
## Contributing to DKAN

If you are doing development work on the DKAN module itself, add the --moduledev flag to the dkan-init command:

If you are doing development work on the DKAN module itself, you can substitute
the `ddev dkan-init --moduledev` command for `ddev dkan-init`.
ddev dkan-init --moduledev

This will clone the dkan project into its own directory and tell Composer to
use that repo as the getdkan/dkan package.

## Frontend app installation and build
## Decoupled Frontend app installation and build

DKAN can integrate with a JS/headless app. The DKAN DDev addon has special
commands for dealing with this.
Expand All @@ -64,11 +79,6 @@ First we gather all the dependencies and files necessary for the frontend:

ddev dkan-frontend-install

Note that this command installs the default frontend Drupal theme into the Drupal
site. If have your own and would rather not add the default one, you can use

ddev dkan-frontend-install --theme 0

### Build

Now that you have all the dependencies, you can build the frontend:
Expand All @@ -77,3 +87,13 @@ Now that you have all the dependencies, you can build the frontend:

Currently this command essentially calls `npm run build` within the web container
of DDev.

## Additional Commands

Run `ddev` by itself to get a list of commands available to you.

Run `ddev get --list --all` to get a list of other DDEV add-ons.
## Additional Resources

- [DDEV Documentation](https://ddev.readthedocs.io/en/stable/users/usage/)
- [DKAN Documentation](https://demo.getdkan.org/modules/contrib/dkan/docs/index.html)

0 comments on commit 104562e

Please sign in to comment.