protected function buildSpress(IOInterface $io, InputInterface $input)
    {
        $timezone = $input->getOption('timezone');
        $drafts = $input->getOption('drafts');
        $safe = $input->getOption('safe');
        $env = $input->getOption('env');
        $sourceDir = $input->getOption('source');

        if (is_null($sourceDir) === true) {
            $sourceDir = './';
        }

        if (($realDir = realpath($sourceDir)) === false) {
            throw new \RuntimeException(sprintf('Invalid source path: "%s".', $sourceDir));
        }

        $spress = $this->getSpress($realDir);

        $spress['spress.config.env'] = $env;
        $spress['spress.config.safe'] = $safe;
        $spress['spress.config.drafts'] = $drafts;
        $spress['spress.config.timezone'] = $timezone;

        $resolver = $this->getConfigResolver();
        $resolver->resolve($spress['spress.config.values']);

        if ($spress['spress.config.values']['parsedown_activated'] === true) {
            $this->enableParsedown($spress);


            $io->labelValue('Parsedown converter', 'enabled');
        }

        $spress['spress.io'] = $io;

        return $spress;
    }